Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 我得到ORA-00920:无效的关系运算符_Sql_Oracle - Fatal编程技术网

Sql 我得到ORA-00920:无效的关系运算符

Sql 我得到ORA-00920:无效的关系运算符,sql,oracle,Sql,Oracle,我的查询如下,我得到一个错误 无效的关系运算符 在第4行 select SERIAL from base.base_voucher_used b where b.dw_date_key and serial in (select serial from base.base_voucher_used a where DW_DATE_KEY group by

我的查询如下,我得到一个错误

无效的关系运算符

在第4行

select  SERIAL 
  from base.base_voucher_used b 
 where b.dw_date_key 
   and serial in (select serial 
                    from base.base_voucher_used a 
                   where DW_DATE_KEY 
                   group by serial 
                  having count(*) > 1)

您尚未在where子句中为dw_date_列键指定任何条件

我假设您希望选择那些计数大于1的序列号。如果是这样,那么只有一个查询就足够了

select serial 
  from base.base_voucher_used a 
 where DW_DATE_KEY = 1  --add your condition here
 group by serial 
having count(*) > 1