mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-22 10:44:19 +01:00
37 lines
477 B
SQL
37 lines
477 B
SQL
-- LIMBO_SKIP: subquery in where not supported
|
|
|
|
|
|
select
|
|
c_name,
|
|
c_custkey,
|
|
o_orderkey,
|
|
o_orderdate,
|
|
o_totalprice,
|
|
sum(l_quantity)
|
|
from
|
|
customer,
|
|
orders,
|
|
lineitem
|
|
where
|
|
o_orderkey in (
|
|
select
|
|
l_orderkey
|
|
from
|
|
lineitem
|
|
group by
|
|
l_orderkey having
|
|
sum(l_quantity) > 313
|
|
)
|
|
and c_custkey = o_custkey
|
|
and o_orderkey = l_orderkey
|
|
group by
|
|
c_name,
|
|
c_custkey,
|
|
o_orderkey,
|
|
o_orderdate,
|
|
o_totalprice
|
|
order by
|
|
o_totalprice desc,
|
|
o_orderdate
|
|
limit 100;
|