Files
turso/perf/tpc-h/queries/3.sql
Jussi Saurio a783f82470 bench/tpch: remove "cast('yyyy-mm-dd' as datetime)"
this causes sqlite and tursodb to interpret the value as just 'yyyy',
e.g. '1995-01-01' becomes '1995', causing a lot of the queries not to
return any results, which is not what we want.
2025-09-26 15:55:38 +03:00

24 lines
390 B
SQL

select
l_orderkey,
sum(l_extendedprice * (1 - l_discount)) as revenue,
o_orderdate,
o_shippriority
from
customer,
orders,
lineitem
where
c_mktsegment = 'FURNITURE'
and c_custkey = o_custkey
and l_orderkey = o_orderkey
and o_orderdate < '1995-03-29'
and l_shipdate > '1995-03-29'
group by
l_orderkey,
o_orderdate,
o_shippriority
order by
revenue desc,
o_orderdate
limit 10;