SQL 中 where 后面可不可以跟上子查询
例: 
       select   编号,姓名   from   学生信息表   where   编号=(select   编号   from   学生成绩表)   
 如不能怎么解决
------解决方案----------------------子查询的结果如果大于1条就需要用in: 
 select 编号,姓名 from 学生信息表 where 编号 in(select 编号 from 学生成绩表)   
 也可以加条件限制字查询只返回一条记录: 
 select 编号,姓名 from 学生信息表 where 编号=(select top 1 编号 from 学生成绩表)
------解决方案--------------------select a.编号,a.姓名 from 学生信息表 a where exists  
 ( 
     select 1 from 学生成绩表 b where b.编号 = a.编号 
 )
------解决方案--------------------可以用in,也可以用exists,但推荐用inner join,inner join效率会更好 
 in: 
 select 编号,姓名 from 学生信息表 where 编号 in (select 编号 from 学生成绩表) 
 exists: 
 select 编号,姓名 from 学生信息表 as a where exists (select 1 from 学生成绩表.编号=a.编号) 
 inner join: 
 select 编号,姓名 from 学生信息表 as a inner join 学生成绩表 as b on a.编号=b.编号   
 in和exists可能引起全表扫描,inner join 则可以用到索引(只要你建好了索引)     
------解决方案----------------------把等号 改成 in 
   select 编号,姓名 from 学生信息表 where 编号 in (select 编号 from 学生成绩表)