-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
SELECT * FROM t1 ORDER BY f1
GO
SELECT f1,f2,ROW_NUMBER() OVER (ORDER BY f1) n FROM t1 ORDER BY f1
GO
SELECT * FROM (SELECT f1,f2,ROW_NUMBER() OVER (ORDER BY f1) n FROM t1) x WHERE n % 4 = 1 OR n % 4 = 0  ORDER BY f1
GO
