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

求一语句
SQL code
select * from f3002
where ixkitl='CR02CB(2+2)DWKL'

select litm from old02 where litm='CR02CB(2+2)DWKL'

这两个函数查询都有结果。但是下面的语句就不可以。为什么?

SQL code
select * from f3002
where ixkitl =(select litm from old02 where litm='CR02CB(2+2)DWKL');


求正确语句

------解决方案--------------------
SQL code
select * from f3002
where ixkitl in (select litm from old02 where litm='CR02CB(2+2)DWKL');

------解决方案--------------------
探讨
SQL code

select * from f3002
where ixkitl in (select litm from old02 where litm='CR02CB(2+2)DWKL');

------解决方案--------------------

子查询要用In,不要直接用那个等号,
select * from f3002
where ixkitl in (select litm from old02 where litm='CR02CB(2+2)DWKL');

仔细检查一下ixkitl与litm是不是对应的?