All pastes #612234 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-07-10 08:23 UTC
rendered paste body
SELECT 
	storename, 
	dt, 
	date_part('hour', time) AS hr, 
	sum((subtotal-discounts)/1.12) AS ns, count(*) AS tc 
FROM txnsummary 
WHERE 
	storename = 'kfc.roces' AND
	dt BETWEEN '2007-01-02' AND '2007-01-02'
GROUP BY storename, dt, hr
ORDER BY hr