Loading plan…
/* using 19620718 as a seed to the RNG */
SELECT
TOP 20
c_custkey,
c_name,
SUM(l_extendedprice * (
1 - l_discount
)) AS revenue,
c_acctbal,
n_name,
c_address,
c_phone,
c_comment
FROM customer, orders, lineitem, nation
WHERE
c_custkey = o_custkey
AND l_orderkey = o_orderkey
AND o_orderdate >= CAST('1993-04-01' AS DATE)
AND o_orderdate < DATEADD(MONTH, 3, CAST('1993-04-01' AS DATE))
AND l_returnflag = 'R'
AND c_nationkey = n_nationkey
GROUP BY
c_custkey,
c_name,
c_acctbal,
c_phone,
n_name,
c_address,
c_comment
ORDER BY
revenue DESC;
Step details
Loading plan…
Green: scan · yellow: join · purple: row movement. Rows and costs are optimiser estimates; costs use model units.