日期:2014-05-17  浏览次数:20375 次

sql语句写法问题,还请赐教
select name,(select * from aaa where name = 当前name) from aaa

需要怎么写法?

也就是说,我想要嵌套的查询语句的where条件name 等于当前查询的name 


------解决方案--------------------
select name,(select xx from aaa where name = a.name) from aaa a
不能用*吧,只能写一列
------解决方案--------------------
select name,(select 这里只能有一个字段出现 from aaa  b where a.name = b.name) from aaa a