Q
qumingfei
Unregistered / Unconfirmed
GUEST, unregistred user!
SELECT Q_REALDATE= case when (GROUPING(Q_PLACE) = 0) THEN q_realdate when (GROUPING(Q_REALDATE) = 1) THEN '2222-2-2' ELSE ISNULL(Q_REALDATE, '2009-2-2') end , Q_SDDD= case when (GROUPING(Q_PLACE) = 0) THEN Q_SDDD when (GROUPING(Q_SDDD) = 1) THEN ' ' ELSE ISNULL(Q_SDDD, ' ') end , Q_PLACE=CASE WHEN (GROUPING(Q_PLACE)=0) THEN Q_PLACE WHEN (GROUPING(Q_PLACE)=1) AND (GROUPING(Q_SDDD) = 0) THEN '小计' else isnull(Q_PLACE,'UNKWOWN') end ,sum(SUMQTY),SUM(SUMBOX) as SUMT,Q_EMPNAME,Q_AUTONO FROM QUMF WHERE q_realdate is not null GROUP BY Q_REALDATE,Q_SDDD,Q_PLACE,Q_EMPNAME,Q_AUTONO WITH ROLLUP2008-09-15 00:00:00.000 绍兴 海神 6324.000 18.000 刘长燕 8090166 2008-09-15 00:00:00.000 绍兴 海神 6324.000 18.000 刘长燕 NULL2008-09-15 00:00:00.000 绍兴 海神 6324.000 18.000 NULL NULL2008-09-15 00:00:00.000 绍兴 小计 6324.000 18.000 NULL NULL