读书人

求一语句,该怎么解决

发布时间: 2012-02-21 16:26:23 作者: rapoo

求一语句

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

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

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


求正确语句

[解决办法]
SQL code
select * from f3002where 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是不是对应的?

读书人网 >oracle

热点推荐