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

oracle数据库,该如何解决

2013-01-02 
oracle数据库怎样将查询出来的结果作为另一个查询的条件例如:将select distinct substr(filter,4) from t_

oracle数据库
怎样将查询出来的结果作为另一个查询的条件
例如:
将select distinct substr(filter,4) from t_Wage_Status
 where companyid = '43f00833-586d-4f53-81c7-1e10f528ca9c' 
 and year = 2012 and month = 10   (A)
查出来的结果作为select * from t_wage_personnel  (B)的条件

问题:
  select * from t_wage_personnel 
 where 
      (
         select distinct substr(filter,4) from t_Wage_Status
          where companyid = '43f00833-586d-4f53-81c7-1e10f528ca9c' 
          and year = 2012 and month = 10 
      ) 
  为什么不行?求解

补充:A查询出来的结果是
 CompanyID='43f00833-586d-4f53-81c7-1e10f528ca9c' AND EMPLOYEETYPE='1' 这样的



[解决办法]
你试试这样


select * from t_wage_personnel 
 where 
      (
         select distinct substr(filter,4) from t_Wage_Status
          where companyid = '43f00833-586d-4f53-81c7-1e10f528ca9c' 
          and year = 2012 and month = 10 
      )  
[解决办法]
 ' and 1' = '1'

热点排行
Bad Request.