pdbench/MayBMS-tpch/query2.sql

2 lines
1.3 KiB
SQL

create table res as select l_extendedprice from (select U1.C1 as C1,U1.W1 as W1,U1.C2 as C2, U1.W2 as W2, U2.C1 as C3,U2.W1 as W3,U2.C2 as C4, U2.W2 as W4,l_extendedprice,l_discount,lineitem_tid from (select U1.C1 as C1,U1.W1 as W1, U2.C1 as C2,U2.W1 as W2,l_extendedprice,lineitem_tid from (select U.C1 as C1,U.W1 as W1,lineitem_tid from (select * from (select C1, W1, tid as lineitem_tid, l_quantity from U_l_quantity) as X50 where l_quantity < '24') U) as U1 join (select C1, W1, tid as lineitem_tid, l_extendedprice from U_l_extendedprice) as U2 using (lineitem_tid) where (U1.C1 <> U2.C1 or U1.W1 = U2.W1)) as U1 join (select U1.C1 as C1,U1.W1 as W1, U2.C1 as C2,U2.W1 as W2,l_discount,lineitem_tid from (select U.C1 as C1,U.W1 as W1,lineitem_tid from (select * from (select C1, W1, tid as lineitem_tid, l_shipdate from U_l_shipdate) as X51 where l_shipdate > '1994-01-01' and l_shipdate < '1996-01-01') U) as U1 join (select * from (select C1, W1, tid as lineitem_tid, l_discount from U_l_discount) as X52 where l_discount > '0.05' and l_discount < '0.08') as U2 using (lineitem_tid) where (U1.C1 <> U2.C1 or U1.W1 = U2.W1)) as U2 using (lineitem_tid) where (U1.C2 <> U2.C2 or U1.W2 = U2.W2) and (U1.C2 <> U2.C1 or U1.W2 = U2.W1) and (U1.C1 <> U2.C2 or U1.W1 = U2.W2) and (U1.C1 <> U2.C1 or U1.W1 = U2.W1))X53;