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

tpch.q4.sql Maven / Gradle / Ivy

There is a newer version: 1.2.23
Show newest version
-- database: presto; groups: tpch; tables: orders,lineitem
SELECT o_orderpriority,
       count(*) AS order_count
FROM orders
WHERE o_orderdate >= DATE '1993-07-01'
  AND o_orderdate < DATE '1993-07-01' + INTERVAL '3' MONTH
  AND EXISTS(
        SELECT *
        FROM lineitem
        WHERE l_orderkey = o_orderkey
          AND l_commitdate < l_receiptdate
    )
GROUP BY o_orderpriority
ORDER BY o_orderpriority




© 2015 - 2024 Weber Informatics LLC | Privacy Policy