




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
TTS6.0(ORACLE達(dá)內(nèi)ITORACLESQL列出客戶以及開通的登錄業(yè)務(wù)的數(shù)列出客戶以及他的推薦哪些客戶是推薦列出客戶以及他的推薦列出客戶以及所開通的登錄業(yè)務(wù)的信息(沒有申請登錄業(yè)務(wù)的客戶列出客戶以及開通的登錄業(yè)務(wù)的數(shù)哪些客戶不是推薦哪些UNIX服務(wù)器上沒有os帳號顯示客戶的顯示客戶huangrong的顯示各個(gè)段的客戶數(shù)(沒有客戶的段不用出現(xiàn)在結(jié)果集中顯示各 段的客戶數(shù)(沒有客戶的段的客戶數(shù)為當(dāng)月 時(shí)長為20小時(shí),單位費(fèi)用漲5分,為40小時(shí)漲3分,其他不變(列出客戶以及他的推薦sun280和sun-server上 登錄業(yè)務(wù)使用了哪些相同的資費(fèi)標(biāo)哪臺UNIX服務(wù)器上沒有開通登錄業(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表,但包含兩列:客戶和推薦人的,所謂推薦人是指他的帳務(wù)帳號是別人的mendi,假設(shè)huanng的帳務(wù)帳號ID是1,luwuhuang的帳務(wù)帳號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,因此找不到對應(yīng)的帳務(wù)帳號id跟他匹配。外連接的一個(gè)應(yīng)用場景就是讓匹配不上的記錄也出現(xiàn)在結(jié)果集中。選擇accounta1表做fromaccounta1leftjoinaccountmender_id=selecta1.real_namefromaccounta1leftjoinaccountmender_id=列出客戶以及所開通的登錄業(yè)務(wù)的信息(沒有申請登錄業(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實(shí)現(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)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 質(zhì)量管理體系在注塑工業(yè)的商業(yè)價(jià)值
- 跨境電商平臺在旅游商品銷售中的角色
- 零售行業(yè)中的財(cái)務(wù)成本控制方案
- 浙江鴨2025版高中生物考前特訓(xùn)選擇題快練考點(diǎn)5遺傳的分子基礎(chǔ)含解析
- 高中語文情感美文第156張票根
- 貴州2025年02月貴州出入境邊防檢查總站所屬事業(yè)單位公開招考1名工作人員筆試歷年典型考題(歷年真題考點(diǎn))解題思路附帶答案詳解
- 高中語文情感美文最美麗的你在路上
- 小學(xué)數(shù)學(xué)教研學(xué)習(xí)培養(yǎng)學(xué)生數(shù)學(xué)的創(chuàng)新意識五六年級上
- 跨境電商平臺物流優(yōu)化策略
- 財(cái)商教育與財(cái)務(wù)知識庫的建設(shè)
- 2025年中央一號文件高頻重點(diǎn)考試題庫150題(含答案解析)
- 接觸隔離標(biāo)準(zhǔn)操作流程
- 港股基礎(chǔ)知識
- 2025年溫州市甌海旅游投資集團(tuán)有限公司下屬子公司招聘筆試參考題庫附帶答案詳解
- 2025年天津三源電力集團(tuán)有限公司招聘筆試參考題庫含答案解析
- 2025年上半年浙江嘉興桐鄉(xiāng)市水務(wù)集團(tuán)限公司招聘10人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年腹腔穿刺術(shù)課件 (1)2
- (八省聯(lián)考)2025年高考綜合改革適應(yīng)性演練 物理試卷合集(含答案逐題解析)
- 2024年干式電力電容器項(xiàng)目可行性研究報(bào)告
- 河南12系列建筑設(shè)計(jì)圖集一(12YJ1)
- 2025年度智能倉儲管理系統(tǒng)軟件開發(fā)合同6篇
評論
0/150
提交評論