Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- (soldable1_.code||'_'||transactio0_.position_positionID||CASE
- WHEN transactio2_.transactionalEventNature='PumpTest' THEN '_PT'
- ELSE '_OT'
- END) AS col_0_0_,
- SUM(transactio0_.salesQuantity) AS col_1_0_,
- SUM(transactio0_.salesAmount) AS col_2_0_
- FROM
- transactionline transactio0_
- INNER JOIN
- productdescription soldable1_
- ON transactio0_.soldable_soldableid=soldable1_.id
- INNER JOIN
- transactionalevent transactio2_
- ON transactio0_.storeEvent_eventID=transactio2_.eventID
- INNER JOIN
- storeevent transactio2_1_
- ON transactio2_.eventID=transactio2_1_.eventID
- WHERE
- transactio2_1_.gasstation_gasstationid=153
- AND soldable1_.dtype='FuelGrade'
- AND (
- soldable1_.code IN (
- '98' , '95' , '94' , '90'
- )
- )
- AND (
- transactio0_.position_positionID IN (
- 186213527 , 186203992 , 186214359 , 186203404 , 186212794 , 186215011 , 186214704 , 186213809 , 186203657 , 186213058 , 186213362 , 186214122
- )
- )
- AND transactio2_1_.eventEndDate>='2012-01-22 15:24:18.418'
- AND transactio2_1_.eventEndDate<='2012-01-22 23:15:58.739'
- GROUP BY
- (soldable1_.code||'_'||transactio0_.position_positionID||CASE
- WHEN transactio2_.transactionalEventNature='PumpTest' THEN '_PT'
- ELSE '_OT'
- END)
Add Comment
Please, Sign In to add comment