1
0

tpch_query19.sql 941 B

1234567891011121314151617181920212223242526272829303132333435
  1. select
  2. sum(l_extendedprice* (1 - l_discount)) as revenue
  3. from
  4. lineitem,
  5. part
  6. where
  7. (
  8. p_partkey = l_partkey
  9. and p_brand = 'Brand#32'
  10. and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
  11. and l_quantity >= 7 and l_quantity <= 7 + 10
  12. and p_size between 1 and 5
  13. and l_shipmode in ('AIR', 'AIR REG')
  14. and l_shipinstruct = 'DELIVER IN PERSON'
  15. )
  16. or
  17. (
  18. p_partkey = l_partkey
  19. and p_brand = 'Brand#35'
  20. and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
  21. and l_quantity >= 15 and l_quantity <= 15 + 10
  22. and p_size between 1 and 10
  23. and l_shipmode in ('AIR', 'AIR REG')
  24. and l_shipinstruct = 'DELIVER IN PERSON'
  25. )
  26. or
  27. (
  28. p_partkey = l_partkey
  29. and p_brand = 'Brand#24'
  30. and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
  31. and l_quantity >= 26 and l_quantity <= 26 + 10
  32. and p_size between 1 and 15
  33. and l_shipmode in ('AIR', 'AIR REG')
  34. and l_shipinstruct = 'DELIVER IN PERSON'
  35. );