# -------------------------------------------------------------- # # Test case migrated from Autopilot Window functions test suite # # Author: Daniel Lee, daniel.lee@mariadb.com # -------------------------------------------------------------- # # --source ../include/have_columnstore.inc # use tpch1m; # select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS UNBOUNDED PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS UNBOUNDED PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS UNBOUNDED PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS UNBOUNDED PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS UNBOUNDED PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS UNBOUNDED PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS UNBOUNDED PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS UNBOUNDED PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from orders order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS UNBOUNDED PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS UNBOUNDED PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY 55 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS UNBOUNDED PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS UNBOUNDED PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY o_custkey ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS UNBOUNDED PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS UNBOUNDED PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey) ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS UNBOUNDED PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS UNBOUNDED PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN UNBOUNDED PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN CURRENT ROW AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND UNBOUNDED FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND CURRENT ROW) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 PRECEDING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 PRECEDING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2; select o_custkey, MIN(o_custkey) OVER (PARTITION BY abs(o_custkey)+2 ORDER BY o_custkey ,o_orderkey ,o_orderdate ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s order by 1, 2;