由ORA 00979錯誤發現ORACLE乙個BUG

2021-06-16 05:11:36 字數 2443 閱讀 5275

今天測試在執行乙個sql語句的時候,報錯ora-00979錯誤。

sql如下:

select rownum, k.*

from (select a.t_contract_begindate,

a.t_contract_enddate,

a.t_contract_id as t_contract_id,

a.t_contract_code as t_contract_code,

a.t_contract_name as t_contract_name,

(select user_name

from t_pub_user u

where u.user_id = a.t_contract_creator) as t_contract_creator,

a.t_contract_createtime as t_contract_createtime,

(select d.dept_name

from t_pub_dept d

where d.dept_id = a.t_contract_chengbandept) as t_contract_zhubandept,

(select u.user_name

from t_pub_user u

where u.user_id = a.t_contract_chengbanuser) as t_contract_chengbanuser,

(select u.user_name

from t_pub_user u

where u.user_id = a.t_contract_execuser) as t_contract_execdeptuser,

(select s.name

from t_con_status s

where s.code = a.t_contract_curstate) as t_contract_curstate,

(select base.t_base_valuename

from t_con_base base

where base.t_base_valueid = a.t_contract_phase) as t_contract_phase,

(select base.t_base_valuename

from t_con_base base

where base.t_base_valueid = a.t_contract_type) as t_contract_type,

a.t_contract_validflag as t_contract_validflag,

a.t_contract_signdate as t_contract_signdate,

a.t_contract_signperson as t_contract_signperson,

a.t_contract_sendcheckdate as t_contract_sendcheckdate,

a.t_contract_checkenddate as t_contract_checkenddate,

b.t_finance_rmbmoney as t_finance_rmbmoney,

b.t_finance_money as t_finance_money,

v.jingbanuser as jingbanuser,

v.jingbandept as jingbandept

from t_con_contract a

left join t_con_finance b on a.t_contract_id =

b.t_finance_contractid

left join t_con_consupplier g on a.t_contract_id = g.contractid

where a.t_contract_validflag = 1

where t_contract_id = a.t_contract_id)

and 1 = 1

and a.t_contract_company = '0'

and (a.t_contract_htgs = 'cmhn' or

',' || v.jingbanuser || ',' like '%,admin,%')

and (a.t_contract_curstate in ('50', '40', '84', '60', '$$$$'))

order by t_contract_createtime desc) k

where rownum < 1001

在網上查了一下資料,可能為oracle乙個bug,需要修改oracle的乙個設定:

在pl sql中執行:

alter system set "_complex_view_merging" = false scope = spfile;

然後重啟oracle,再執行sql語句,執行正常。

ORA 00979解決辦法

1 如下語句 select p.gwszbm as 崗位所在部門id sum to number p.xqrs as 需求人數 o.name 部門名稱 from position p,lborganization o where o.id p.gwszbm group by p.gwszbm 報錯 ...

ORA 00979 不是 GROUP BY 表示式

使用聚合函式中用group by來分組資料時特別說明了select 列表項中不存在的列可以出現在group by的列表項中,但反過來就不行了,在select列表項 現的列必須全部出現在group by後面 聚合函式除外 但一些朋友經常愛把select 列表項的中列忘了寫在group by中。於是就出...

oracle 錯誤解決ORA 12505

sql plu可以連線,但是使用jdbc連線oracle的時候報資料庫的錯誤ora 12505 監聽程式當前無法識別連線描述符中所給出的sid 這個是由於oracle的service name 和sid name不一致,而pl sql developer和sqlplus 採用service name...