課程
/數(shù)據(jù)庫(kù)
/SQL Server
/SQL Server基礎(chǔ)--T-SQL語(yǔ)句
比如查某個(gè)部門購(gòu)買的哪些商品是所有部門都沒(méi)有買過(guò)的,這個(gè)需要嵌套select嗎?
2018-07-22
源自:SQL Server基礎(chǔ)--T-SQL語(yǔ)句 2-6
正在回答
select distinct(item)? from? table? where? item? not? in? (select? distinct(item)? from? table? where? bumen<>'mouge')? ?and? bumen='mouge'? ? ? ? ? ?-----------------不知道對(duì)不對(duì)......等待實(shí)踐檢驗(yàn)
select?*?from? something?where?name?in?(select?name?from??something?group?by?name?having?COUNT(*)>1)
select
*?
from
?
where
name
in
(
something?
group
by
having
COUNT
(*)>1)
冰楓565
舉報(bào)
SQL Server基礎(chǔ)教程,主要講解TSQL的基本查詢語(yǔ)句和基本用法
1 回答查詢的時(shí)候 排序 問(wèn)題是先查后排 還是先排后查
1 回答額。。只有查詢么
1 回答查詢語(yǔ)句的問(wèn)題
1 回答老師,我想問(wèn)一下這個(gè)ER圖是怎么實(shí)現(xiàn)的
1 回答查詢用下劃線(_)和百分號(hào)(%)的問(wèn)題
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-09-02
select distinct(item)? from? table? where? item? not? in? (select? distinct(item)? from? table? where? bumen<>'mouge')? ?and? bumen='mouge'? ? ? ? ? ?-----------------不知道對(duì)不對(duì)......等待實(shí)踐檢驗(yàn)
2018-07-24
select
?*?
from
? something?
where
?name
?in
?(
select
?name
?from
??something?
group
?by
?name
?having
?COUNT
(*)>1)