查詢sql:sql
SELECT * from T_QL_CASE q where q.CASE_OID IN( select f.CASE_OID,f.FINAL_STATUS from T_QL_CASE_APPROVAL_FINAL f where FINAL_STATUS='2' OR FINAL_STATUS='33' OR FINAL_STATUS='43' OR FINAL_STATUS='34' OR FINAL_STATUS='5');
問題緣由:spa
SELECT * from T_QL_CASE q
where q.CASE_OID IN(
select f.CASE_OID,f.FINAL_STATUS
from T_QL_CASE_APPROVAL_FINAL f
where FINAL_STATUS='2'
OR FINAL_STATUS='33'
OR FINAL_STATUS='43'
OR FINAL_STATUS='34'
OR FINAL_STATUS='5');code
兩個紅色的地方,where後面的列數應該和 in(select cloum1,clounm2)中select的列數相同。io
當INSERT報這個錯誤時,通常是插入數據的列數不一致。select
原sql: insert into abc.employees select * from employees where employee_id=100; 報錯: Error starting at line 1 in command: insert into abc.employees select * from employees where employee_id=100; Error at Command Line:1 Column:25 Error report: SQL Error: ORA-00913: too many values 00913. 00000 - "too many values" *Cause: *Action: 解決辦法::: 應按以下所示指定列名稱 insert into abc.employees (col1,col2) select col1,col2 from employees where employee_id=100; 若是employees有112列(原文如此!)嘗試在下面運行以選擇比較兩個表的列 select * from ALL_TAB_COLUMNS ATC1 left join ALL_TAB_COLUMNS ATC2 on ATC1.COLUMN_NAME = ATC1.COLUMN_NAME and ATC1.owner = UPPER('2nd owner') where ATC1.owner = UPPER('abc') and ATC2.COLUMN_NAME is null AND ATC1.TABLE_NAME = 'employees' 而後您應該將表升級爲具備相同的結構