




版權(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直接換為上述查詢語(yǔ)句,這樣的查詢形式稱為非關(guān)聯(lián)子查詢。語(yǔ)句的執(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語(yǔ)句不會(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. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 公司聚餐自助餐活動(dòng)方案
- 公司桶裝水活動(dòng)方案
- 公司研討活動(dòng)方案
- 公司禮儀禮節(jié)活動(dòng)方案
- 公司活力秀活動(dòng)方案
- 公司組織趣聞活動(dòng)方案
- 公司新年節(jié)目策劃方案
- 公司演唱會(huì)年會(huì)策劃方案
- 公司月會(huì)具體活動(dòng)方案
- 公司新春活動(dòng)策劃方案
- 安全檢查作業(yè)行為規(guī)范與專業(yè)知識(shí) -改
- 學(xué)校信息化建設(shè)十五五規(guī)劃方案
- 2025年保險(xiǎn)專業(yè)知識(shí)能力測(cè)試題及答案
- 小學(xué)民法典主題班會(huì)教案
- 水利工程隱患排查課件
- 辦公軟件實(shí)操試題及詳細(xì)答案
- 米粉項(xiàng)目可行性分析報(bào)告
- 腰痛中醫(yī)護(hù)理查房
- 八五普法自查自評(píng)情況報(bào)告
- 競(jìng)彩資格考試試題及答案
- esg考試試題及答案
評(píng)論
0/150
提交評(píng)論