All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sql-tests.testcases.hive_tpch.q03.sql Maven / Gradle / Ivy

There is a newer version: 464
Show newest version
-- database: presto; groups: tpch; tables: customer,orders,lineitem
SELECT
  l_orderkey,
  sum(l_extendedprice * (1 - l_discount)) AS revenue,
  o_orderdate,
  o_shippriority
FROM
  customer,
  orders,
  lineitem
WHERE
  c_mktsegment = 'BUILDING'
  AND c_custkey = o_custkey
  AND l_orderkey = o_orderkey
  AND o_orderdate < DATE '1995-03-15'
  AND l_shipdate > DATE '1995-03-15'
GROUP BY
  l_orderkey,
  o_orderdate,
  o_shippriority
ORDER BY
  revenue DESC,
  o_orderdate
LIMIT 10




© 2015 - 2024 Weber Informatics LLC | Privacy Policy