一、網上都是這么說的:
出現這種錯誤,要先看一下是不是sql中有用到連接:union,unio all之類的,如果有,需要注意相同名稱字段的數據類型一定要相同。
select a.time from A a union all select b.time from B b where a.name = b.name;
例如上現那句sql,要注意A和B中的time字段可能一個是date格式,一個是字符串格式,總之可能不是相同格式。一定要注意。
二、但是我還要補充一句
我寫了兩個sql,使用union all連接。
select a.name a.age from studentTabA a union all select b.name b.age from studentTabB b
上述的語句是不會報錯的,但是如果像下面這樣寫也還是會報ORA-01790
select a.age a.name from studentTabA a union all select b.name b.age from studentTabB b