首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

求一语句,该怎么解决

2012-02-21 
求一语句SQL codeselect * from f3002where ixkitlCR02CB(2+2)DWKLselect litm from old02 where litm

求一语句

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是不是对应的?

热点排行