这两句SQL查询结果一致:
请问那句性能更好?效率更高?
a表和b表的关系为一对多, 谢谢!(1) Select Distinct id,name from a join b on a.id=b.id where b.id=10(2) Select id,name from a where exists (select id from b where a.id=b.id and b.id=10)
请问那句性能更好?效率更高?
a表和b表的关系为一对多, 谢谢!(1) Select Distinct id,name from a join b on a.id=b.id where b.id=10(2) Select id,name from a where exists (select id from b where a.id=b.id and b.id=10)
另, id 列的来源不明
(1) Select Distinct a.id,a.name from a join b on a.id=b.id where b.id=10(2) Select a.id,a.name from a where exists (select id from b where a.id=b.id and b.id=10)