select au_id from authors a,titleauthor ta
where a.au_id=ta.au_idgo是查两边的连接在一起如果
a b
1 2
-------
a b
1 4
1 6
用a来连接出来的是两条记录select au_id from authors
where exists(select * from titleauthor ta
where authors.au_id=ta.au_id)是查表a里的记录,且在表b里存在的
a b
1 2
-------
a b
1 4
1 6出来的是一条记录,应为是查表1的记录而不是把两表关连
where a.au_id=ta.au_idgo是查两边的连接在一起如果
a b
1 2
-------
a b
1 4
1 6
用a来连接出来的是两条记录select au_id from authors
where exists(select * from titleauthor ta
where authors.au_id=ta.au_id)是查表a里的记录,且在表b里存在的
a b
1 2
-------
a b
1 4
1 6出来的是一条记录,应为是查表1的记录而不是把两表关连
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货