求一select * from table where name = select from table 的语句例子.
求一select * from table where name = select from table 的语句例子.
------解决方案--------------------select * from table1 where name in (select name from table2)
------解决方案--------------------select * from table where name = select top 1 name from table2
------解决方案--------------------select * from table where name in (select name from table)
------解决方案--------------------select * from table1 where name in (select name from table2)
------解决方案--------------------select * from table where id= select max(ic) from table2
------解决方案--------------------select * from tablea where name in (select name from tablebB where name= 'aaa ')
------解决方案--------------------select * from table where name = select from table
当然不能这样写,一个值等于一个集合,会报错哈。
------解决方案--------------------select * from table1 where name in (select name from table2)
------解决方案--------------------select * from table1 a where exists (select 8 from table2 b where a.name = b.name)