q6.sql 470 B

12345678910111213141516
  1. -- TPC-H/TPC-R Forecasting Revenue Change Query (Q6)
  2. -- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
  3. -- using 1680793381 as a seed to the RNG
  4. $border = Date("1995-01-01");
  5. select
  6. sum(l_extendedprice * l_discount) as revenue
  7. from
  8. plato.lineitem
  9. where
  10. CAST(l_shipdate AS Timestamp) >= $border
  11. and cast(l_shipdate as Timestamp) < ($border + Interval("P365D"))
  12. and l_discount between 0.07 - 0.01 and 0.07 + 0.01
  13. and l_quantity < 25;