时间:2021-07-01 10:21:17 帮助过:23人阅读
aid, title,content-----------------------------------------1 Qt助力跨平台应用开发,势不可挡2 Qt助力跨平台应用开发,势不可挡3 Qt助力跨平台应用开发,势不可挡4 Qt助力跨平台应用开发,势不可挡
tid,tname--------------------------------1 生活2 技术3 科技4 娱乐
aid,tid----------------------------1 11 21 32 12 32 43 13 23 44 14 2
select a.* from article as a left join art_tags at on at.aid=a.aid where at.tid=2
select a.* from article as a left join art_tags at on at.aid=a.aid where at.tid=2
select * from article where aid in(select aid from art_tags where tid in(select tid from tags where tname='技术'));
select a.* from article a left join art_tags b on a.aid=b.aid left join tags c on c.tid=b.tid where b.tname='技术'
谢谢!
原来where也可以这么写