我在刪除NULLS時遇到困難。 ISNULL聲明似乎適用於動態結果,但不適用於第二種。從條件聚合結果中刪除NULLS
我最終提取查詢是:顯示
select itemid,title,description,cat,fibre,washing,colours,promo,
max(case when seqnum = 1 then isnull(chm_sizegrouping,'') end) as sizes_1,
max(case when seqnum = 2 then isnull(chm_sizegrouping,'') end) as sizes_2,
max(case when seqnum = 3 then chm_sizegrouping end) as sizes_3,
max(case when seqnum = 4 then chm_sizegrouping end) as sizes_4)
結果是:
itemid sizes_1 sizes_2
LM008 one NULL
LM009 NULL
LM010 NULL
lm011 NULL
任何幫助是非常讚賞,
感謝。
好吧,我感到很蠢.................. :( – DanDan
It works。Thank you! – DanDan