![課件課后練習代碼經(jīng)典案例_第1頁](http://file4.renrendoc.com/view/cc9e0d8b84bb4c8bc1d987cd63a9ad85/cc9e0d8b84bb4c8bc1d987cd63a9ad851.gif)
![課件課后練習代碼經(jīng)典案例_第2頁](http://file4.renrendoc.com/view/cc9e0d8b84bb4c8bc1d987cd63a9ad85/cc9e0d8b84bb4c8bc1d987cd63a9ad852.gif)
![課件課后練習代碼經(jīng)典案例_第3頁](http://file4.renrendoc.com/view/cc9e0d8b84bb4c8bc1d987cd63a9ad85/cc9e0d8b84bb4c8bc1d987cd63a9ad853.gif)
![課件課后練習代碼經(jīng)典案例_第4頁](http://file4.renrendoc.com/view/cc9e0d8b84bb4c8bc1d987cd63a9ad85/cc9e0d8b84bb4c8bc1d987cd63a9ad854.gif)
![課件課后練習代碼經(jīng)典案例_第5頁](http://file4.renrendoc.com/view/cc9e0d8b84bb4c8bc1d987cd63a9ad85/cc9e0d8b84bb4c8bc1d987cd63a9ad855.gif)
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
TTS6.0(ORACLE達內(nèi)ITORACLESQL列出客戶以及開通的登錄業(yè)務的數(shù)列出客戶以及他的推薦哪些客戶是推薦列出客戶以及他的推薦列出客戶以及所開通的登錄業(yè)務的信息(沒有申請登錄業(yè)務的客戶列出客戶以及開通的登錄業(yè)務的數(shù)哪些客戶不是推薦哪些UNIX服務器上沒有os帳號顯示客戶的顯示客戶huangrong的顯示各個段的客戶數(shù)(沒有客戶的段不用出現(xiàn)在結(jié)果集中顯示各 段的客戶數(shù)(沒有客戶的段的客戶數(shù)為當月 時長為20小時,單位費用漲5分,為40小時漲3分,其他不變(列出客戶以及他的推薦sun280和sun-server上 登錄業(yè)務使用了哪些相同的資費標哪臺UNIX服務器上沒有開通登錄業(yè)圖-selectfromaccountajoinserviceona.id=selectfromaccountajoinserviceona.id=selectgroupbyselectfromaccountajoinservicesona.id=s.account_idgroupbyselectfromaccountajoinserviceona.id=groupby fromaccounta(selectaccount_id,count(id)fromgroupbyaccount_id)cona.id=c.account_idanda.id=圖-whereid=mender_idfromselectreal_namefromwhereid=1011;結(jié)果集的信息只來自acun表,但包含兩列:客戶和推薦人的,所謂推薦人是指他的帳務帳號是別人的mendi,假設huanng的帳務帳號ID是1,luwuhuang的帳務帳號ID是,endwhereid=mender_idfromselectreal_namefromwhereid=1011;selectselecta1.real_namefromaccounta1joinaccountmender_id=selecta1.real_namefromaccounta1joinaccountonmender_id,a1.id)selecta1.real_namefromaccounta1joinaccountonmender_id,a1.id)=圖- whereid=mender_idfromselectreal_namefromwhereid=1011;selectdistinctfromaccounta1joinaccountmender_id=圖-沒有推薦人的客戶的特征是他的mender_id的值為null,因此找不到對應的帳務帳號id跟他匹配。外連接的一個應用場景就是讓匹配不上的記錄也出現(xiàn)在結(jié)果集中。選擇accounta1表做fromaccounta1leftjoinaccountmender_id=selecta1.real_namefromaccounta1leftjoinaccountmender_id=列出客戶以及所開通的登錄業(yè)務的信息(沒有申請登錄業(yè)圖-fromaccountaleftjoinserviceona.id=selectfromaccountaleftjoinserviceona.id=圖-selectfromaccountaleftjoinserviceona.id=selectgroupbyselectfromaccountaleftjoinservicesona.id=s.account_idgroupby圖-selectfromaccounta1joinaccountona1.idselectfromaccounta1leftjoinaccountselectfromaccounta1leftjoinaccountona1.id就用它們的共同特征,匹配表accounta2的非空列為null了。selectfromaccounta1leftjoinaccountona1.idwherea2.idis圖-selectunix_hostfromwhereos_username=selectselectidfromselecth.idfromhosthleftjoinserviceonh.id=ands.os_username='weixb'wheres.idisnull;顯示客戶的圖-round((sysdate-round((sysdate-round((sysdate-birthdate)/365round((sysdate-birthdate)/365)betweenlowageandselectfromaccountajoinage_segmentonround((sysdate-birthdate)/365)betweenlowageandPAGE11PAGE11.1問題圖-round((sysdateround((sysdate-round((sysdate-birthdate)/365)betweenround((sysdate-birthdate)/365)betweenlowageandandreal_name=selectfromaccountajoinage_segmentonround((sysdate-birthdate)/365)betweenlowageandhiageandreal_name='huangrong';圖-selectfromaccountajoinage_segmentonround((sysdate-birthdate)/365)selectfromaccountajoinage_segmentonround((sysdate-birthdate)/365)betweenlowageandgroupbygroupbyselectfromaccountajoinage_segmentonround((sysdate-birthdate)/365)betweenlowageandgroupby圖-selectfromaccountarightjoinage_segmentonround((sysdate-birthdate)/365)betweenlowageandselectfromaccountarightjoinage_segmentonround((sysdate-birthdate)/365)betweenlowageandgroupbygroupbyselectfromaccountarightjoinage_segmentonround((sysdate-birthdate)/365)betweenlowageandgroupby變(用UNIONALL實現(xiàn))圖-selectbase_duration,base_cost,unit_cost+fromwherebase_durationselectbase_duration,base_cost,unit_cost+fromwherebase_duration=selectbase_duration,base_cost,unit_costfromwherebase_durationselectbase_duration,base_cost,unit_costfromwherebase_duration=selectselectfromwherebase_durationnotinselectbase_duration,base_cost,unit_costfrom0.05wherebase_duration=unionselect+fromwherebase_duration=unionselectfromwherebase_durationnotinunionselectfromwherebase_durationis圖- mender_id=a2.id,那么沒有推薦人的客戶不會 mender_idisnull獲得的。將兩部分結(jié)果集用unionall拼接在一起,問題解決。selectfromaccounta1joinaccountunionmender_id=selectfrommender_idis圖-fromhosthjoinservicesonhfromhosthjoinservicesonh.id=s.unix_=fromhosthjoinservicefromhosthjoinservicesonh.id=s.unix_='sun-fromho
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年生態(tài)建設策劃與綠色發(fā)展戰(zhàn)略協(xié)議
- 2025年人工智能技術研發(fā)合作協(xié)議
- 2025年專利權保護協(xié)議范例
- 2025年數(shù)據(jù)中心維護服務合同協(xié)議
- 2025年度會員卡購買與銷售協(xié)議范本
- 2025年臨時用工派遣協(xié)議樣本
- 2025年勞動安全賠償協(xié)議書倡議
- 2025年市場營銷內(nèi)部資料保密協(xié)議
- 2025年官方債權轉(zhuǎn)讓協(xié)議范例
- 2025年企業(yè)長期轎車租賃服務協(xié)議合同范本
- 配套課件-前廳客房服務與管理
- 2025年度藥店營業(yè)員服務規(guī)范及合同約束協(xié)議3篇
- 工業(yè)和信息化部裝備工業(yè)發(fā)展中心2025年上半年應屆畢業(yè)生招聘易考易錯模擬試題(共500題)試卷后附參考答案
- 重慶市2024-2025學年高一上學期期末聯(lián)考生物試卷(含答案)
- 2024年醫(yī)師定期考核臨床類考試題庫及答案(共500題)
- 2025安全生產(chǎn)工作目標及實施計劃
- 《高原紅細胞增多癥血液稀釋療法護理操作規(guī)程》
- 應急處置洗消
- 年終抖音運營述職報告
- 【課件】如何保障我國未來的能源安全
- 結(jié)腸術后恢復護理
評論
0/150
提交評論