Guest User

Untitled

a guest
Jun 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.35 KB | None | 0 0
  1. SELECT
  2.         (soldable1_.code||'_'||transactio0_.position_positionID||CASE
  3.         WHEN transactio2_.transactionalEventNature='PumpTest' THEN '_PT'
  4.         ELSE '_OT'
  5.     END) AS col_0_0_,
  6.     SUM(transactio0_.salesQuantity) AS col_1_0_,
  7.     SUM(transactio0_.salesAmount) AS col_2_0_
  8. FROM
  9.     transactionline transactio0_
  10. INNER JOIN
  11.     productdescription soldable1_
  12.         ON transactio0_.soldable_soldableid=soldable1_.id
  13. INNER JOIN
  14.     transactionalevent transactio2_
  15.         ON transactio0_.storeEvent_eventID=transactio2_.eventID
  16. INNER JOIN
  17.     storeevent transactio2_1_
  18.         ON transactio2_.eventID=transactio2_1_.eventID
  19. WHERE
  20.     transactio2_1_.gasstation_gasstationid=153
  21.     AND soldable1_.dtype='FuelGrade'
  22.     AND (
  23.         soldable1_.code IN (
  24.             '98' , '95' , '94' , '90'
  25.         )
  26.     )
  27.     AND (
  28.         transactio0_.position_positionID IN (
  29.             186213527 , 186203992 , 186214359 , 186203404 , 186212794 , 186215011 , 186214704 , 186213809 , 186203657 , 186213058 , 186213362 , 186214122
  30.         )
  31.     )
  32.     AND transactio2_1_.eventEndDate>='2012-01-22 15:24:18.418'
  33.     AND transactio2_1_.eventEndDate<='2012-01-22 23:15:58.739'
  34. GROUP BY
  35.     (soldable1_.code||'_'||transactio0_.position_positionID||CASE
  36.     WHEN transactio2_.transactionalEventNature='PumpTest' THEN '_PT'
  37.     ELSE '_OT'
  38. END)
Add Comment
Please, Sign In to add comment