版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
selectselectmin(create_date)fromselectselectunix_host,os_username,create_datefromwherecreate_date=將inda直接換為上述查詢語句,這樣的查詢形式稱為非關(guān)聯(lián)子查詢。語句的執(zhí)行順序是先執(zhí)行子查詢(只執(zhí)行一遍,若子查詢的返回結(jié)果為多條,系統(tǒng)會(huì)自動(dòng)去重)selectunix_host,os_username,create_datefromwherecreate_date=(selectmin(create_date)from圖-selectcreate_datefromwhereos_username='huangr';andunix_host='192.168.0.26'selectunix_host,create_date,os_usernamefromwherecreate_date(selectcreate_datefromwhereos_username='huangr'andunix_host='192.168.0.26');圖-圖-selectselectcreate_datefromwhereos_username=selectunix_host,create_date,os_usernamefromwhere(selectcreate_datefromservicewhereos_username='huangr');selectunix_host,create_date,os_usernamefromwhere(selectmax(create_date)fromservicewhereos_username='huangr');selectunix_host,create_date,os_usernamefromwhere(selectcreate_datefromservicewhereos_username='huangr');selectunix_host,create_date,os_usernamefromwhere(selectmin(create_date)fromservicewhereos_username='huangr');圖-mender_idfrommender_idfromselectreal_namefromwhereidinmender_idfrom圖-mender_idfrommender_idfrom將上述查詢的結(jié)果作為hee條件的值,即查詢哪些人的帳務(wù)帳號(hào)ID沒有落在上述查詢的結(jié)果集中,也就是哪些人的帳務(wù)帳號(hào)ID跟結(jié)果集中的所有值都不相等。當(dāng)子查詢的返回結(jié)果中包含有null值,對(duì)于ntin(all)來說,l語句不會(huì)返回任何結(jié)果。因?yàn)槿魏胃鷑ull比較,結(jié)果都不是u。selectreal_namefromwherenotmender_idfromaccountmender_idisnotnull);顯示unix服務(wù)器ip地址,開通日期,os帳號(hào)名,結(jié)果集中只包含每臺(tái)unix服務(wù)器上最早開通的os圖-selectunix_host,min(create_date)fromgroupbyselectunix_host,os_username,create_datefromwhere(unix_host,create_date)(selectunix_host,min(create_date)fromservicegroupbyunix_host);圖-selectto_char(min(create_date)+9,'yyyymmdd')fromservicegroupbyselectunix_host,os_username,create_datefromwhere(unix_host,to_char(create_date,'yyyymmdd'))in(selectunix_host,to_char(min(create_date)+fromgroupby圖-selectselectround(sysdate-create_date)selectavg(round(sysdate-create_date))fromservicewherei.unix_host=selectunix_hostos_usernameround(sysdate-create_date)open_agefromserviceowhereround(sysdate-create_date)(selectavg(round(sysdate-fromservicewhereo.unix_host=圖-select1fromservicewhereo.idselectreal_namefromaccountwhereexistsselect1fromaccountwhereo.id圖-selectaccount_idselectaccount_idfromselectselect1fromservicewhereo.id=selectreal_namefromwhereidin(selectaccount_idfromselectreal_namefromaccountwhere(select1fromserviceiwhereo.id=i.account_id);圖-該問題可以用關(guān)聯(lián)子查詢的notexists對(duì)于主表中的記錄來說不存在(notexists)如下情況:他的帳務(wù)帳號(hào)ID是某select1select1fromservicewhereo.id該查詢執(zhí)行后返回norowsselected。注意notexists關(guān)心是否有返回結(jié)果而不是返回結(jié)果具selectreal_namefromaccountwherenot(select1fromaccount圖-selectaccount_idselectaccount_idfromselectselect1fromservicewhereo.id=若沒有,主查詢中的notexists是成立的,即該客戶沒有申請(qǐng)登錄業(yè)務(wù)selectreal_namefromwhereidnotin(selectaccount_idfromselectreal_namefromaccountwherenotexists(select1fromserviceiwhereo.id=圖-fromaccountfromaccountajoinserviceona.id=columnreal_nameformatcolumnos_usernameformata12columnunix_hostformata16fromaccountajoinserviceona.id=圖-fromfromaccountajoins
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度數(shù)字經(jīng)濟(jì)股份抵押貸款擔(dān)保合同
- 2025年度國際貿(mào)易貨物退換貨合同
- 2025年專業(yè)版家禽購銷合同范文(2篇)
- 物業(yè)保潔合同范本簡(jiǎn)易2
- 2024年醫(yī)用真空負(fù)壓機(jī)項(xiàng)目資金需求報(bào)告代可行性研究報(bào)告
- PQA-18-生命科學(xué)試劑-MCE-3779
- Filiformine-生命科學(xué)試劑-MCE-8234
- 11-Hydroxy-9-R-hexahydrocannabinol-生命科學(xué)試劑-MCE-8544
- 4-Iso-THC-4-Iso-tetrahydrocannabinol-生命科學(xué)試劑-MCE-2807
- 2025年度磚廠承包與市場(chǎng)拓展合作協(xié)議
- 2024全國能源行業(yè)火力發(fā)電集控值班員理論知識(shí)技能競(jìng)賽題庫(多選題)
- 公司員工外派協(xié)議書范文
- 信息科技重大版 七年級(jí)上冊(cè) 互聯(lián)網(wǎng)應(yīng)用與創(chuàng)新 第二單元教學(xué)設(shè)計(jì) 互聯(lián)網(wǎng)原理
- 肺栓塞的護(hù)理查房完整版
- 手術(shù)患者手術(shù)部位標(biāo)識(shí)制度
- 運(yùn)輸安全生產(chǎn)知識(shí)培訓(xùn)試卷
- 抖音麗人行業(yè)短視頻直播項(xiàng)目運(yùn)營(yíng)策劃方案
- (2024年)知識(shí)產(chǎn)權(quán)全套課件(完整)
- 2024-2030年中國城市軌道交通行業(yè)發(fā)展現(xiàn)狀分析及市場(chǎng)供需預(yù)測(cè)報(bào)告
- 預(yù)防靜脈血栓疾病知識(shí)講座
- 《社區(qū)康復(fù)》課件-第十一章 其他疾病的社區(qū)康復(fù)實(shí)踐
評(píng)論
0/150
提交評(píng)論