--效率高
select u.* from users u where exists(select userid from student where userid=u.id);
--效率低
select * from student where userid in (select id from users);
in与=的区别
select name from student where name in('李','高','张');
select name from student where name='李',name='高',name='张';
这两句的查询结果相同。