啦啦啦啦員工工資合計程式碼
set serveroutput on; declare cursor cdept is select deptno from dept; pdeptno dept.deptno%type; cursor cemp(dno number) is select sal from emp where deptno=dno; psal emp.sal%type; count1 number; count2 number ; count3 number; totalsal number; begin open cdept; loop fetch cdept into pdeptno; exit when cdept%notfound; count1:=0;count2:=0;count3:=0;totalsal:=0; open cemp(pdeptno); loop fetch cemp into psal; exit when cemp%notfound; if psal = 3000 and psal 6000 then count3:=count3+1; end if; totalsal:=totalsal+psal; end loop; insert into test values(pdeptno,count1,count2,count3,totalsal); close cemp; end loop; close cdept; dbms_output.put_line('完成'); commit; end;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/1727/viewspace-2798447/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- noip模擬33[進階啦啦啦]
- 漫談程式設計師系列:受刺激啦,開篇啦程式設計師
- ThinkCMFX 1.2 釋出啦,URL美化來啦
- 上新啦!KIT!
- 阿里秋招啦阿里
- 圖靈搬家啦!圖靈
- 上新啦KIT
- 迅雷前端招聘啦前端
- 分享乾貨啦!
- Angular 5.0.0來啦Angular
- C#Light/Evil合體啦C#
- 一刻社群程式碼開源啦
- 程式設計師們你們辛苦啦程式設計師
- 開始學習啦
- Web前端群招人啦!Web前端
- It的招聘需求來啦
- 正式開通GitHub啦Github
- MySQL 之旅開始啦MySql
- 【完結啦】TDD 構建論壇課程筆記完結啦筆記
- 分享兩個優惠碼啦:D
- nodejs版本程式碼註釋率統計上新啦~~~NodeJS
- 函式計算工具鏈新成員——FunLocal釋出啦函式
- go-echarts 開源啦GoEcharts
- Mesa 18.2.8釋出啦
- Linux之父回來啦Linux
- 「龍蜥開發者說」徵稿啦!
- Create Vite App 支援 OpenTiny 啦?ViteAPP
- 掌上邑大開源啦!
- 圖靈社群我來啦圖靈
- secureCRT游標不見啦Securecrt
- 講課 PPT 公開啦
- 小程式可以顯示群名稱啦!
- 函式計算工具鏈新成員 —— Fun Local 釋出啦函式
- 【看雪課程】組合語言,開課啦!組合語言
- “魔方大資料”招募合作伙伴啦~大資料
- 大資料是個什麼鬼啦?大資料
- 重磅:Zoho CRM推出新UI啦!UI
- Google要放棄support庫啦!Go