1
有人能幫助我在這,這是當我運行此腳本存儲過程編譯錯誤
ERROR at line 1: ORA-00979: not a GROUP BY expression ORA-06321: at "s3398293.P2", line 7 ORA-06321: at "s3398293.P2", line 18 ORA-06321: at line 1
的代碼我收到錯誤消息:
create or replace
PROCEDURE p2(x NUMBER)
as
staff_info staff.bno%TYPE;
address_info varchar2(20);
CURSOR c1 IS
SELECT staff.bno ,
branch.street || ' ' || branch.suburb || ' ' || branch.postcode
FROM deal , staff, contact , property , branch
where staff.peid = contact.peid
and contact.pno = property.pno
and property.pno = deal.pno
and staff.peid = branch.peid
group by staff.bno
HAVING x > sum(deal.price);
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO staff_info,address_info ;
EXIT WHEN c1%notfound;
dbms_output.put_line('BRANCH# '||' '||'ADDRESS');
dbms_output.put_line(staff_info ||' '|| address_info);
END LOOP;
close c1;
END;
/
能
有人告訴我更多關於GROUP BY EXPRESSION的信息! ?
謝謝。但是,我的LOOP有什麼問題,因爲它只提取一行...... – shakur007
請參閱上面的我的編輯...並且不要忘記將upvote/mark標記爲接受任何有幫助的答案... – Yahia
I有錯誤詢問我需要聲明Staff_info和address_info。但是我已經在聲明塊中聲明瞭它們。 – shakur007