Home > database >  How to improve the union all code???????
How to improve the union all code???????

Time:11-07

 
SELECT '28800102880011' as JGH, sum (ckye) as ckye, sum (dkye) as dkye, sum (blye) as blye, sum (JLR) as JLR from think_daily_report where JGH in (2880010288011)
UNION ALL
SELECT '28800452880005' as JGH, sum (ckye) as ckye, sum (dkye) as dkye, sum (blye) as blye, sum (JLR) as JLR from think_daily_report where JGH in (2880045288005)
UNION ALL
SELECT '288001228800142880046' as JGH, sum (ckye) as ckye, sum (dkye) as dkye, sum (blye) as blye, sum (JLR) as JLR from think_daily_report where JGH in (2880012288014288046)
UNION ALL
SELECT '288004728800482880016288006' as JGH, sum (ckye) as ckye, sum (dkye) as dkye, sum (blye) as blye, sum (JLR) as JLR from think_daily_report where JGH in (2880047288048288016288006)
UNION ALL
SELECT '28800342880033' as JGH, sum (ckye) as ckye, sum (dkye) as dkye, sum (blye) as blye, sum (JLR) as JLR from think_daily_report where JGH in (2880034288033)
UNION ALL
SELECT '28800092880013' as JGH, sum (ckye) as ckye, sum (dkye) as dkye, sum (blye) as blye, sum (JLR) as JLR from think_daily_report where JGH in (2880009288013)
UNION ALL
SELECT '28800322880029' as JGH, sum (ckye) as ckye, sum (dkye) as dkye, sum (blye) as blye, sum (JLR) as JLR from think_daily_report where JGH in (2880032288029)
Union all
The select JGH ckye, dkye blye, JLR from think_daily_report where JGH not in (2880010288011288045288005288012288014288046288047288048288016288006288034288033288009288013288032288029)
  • Related