输入banner图图片脚本导航/分类

SQL SERVER练习

select 分類,mAn=sum(數量) from A where (名稱=m OR 名稱=n) and 2 3 分類 in( 4 --帶m和n的組至少有一組 5 select an.分類 from 6 ( 7 select 分類,countm from 8 (select 分類, countm=count(名稱) from A where 名稱=m group by 分類) cm 9 where cm.countm>=1 10 ) am right join 11 12 ( 13 select 分類,countn from 14 (select 分類, countn=count(名稱) from A where 名稱=n group by 分類) cn 15 where cn.countn>=1 16 ) an on an.分類=am.分類) 17 18 group by 分類

 

SQL SERVER练习

标签: