Figure 4: Row number, within partitions (custid), sorted by unique combination of columns (orderdate, orderid)
custid custrownum orderdate orderid empid qty
A 1 2003-12-24 10005 1 30
A 2 2004-01-09 40001 4 40
A 3 2004-02-12 40005 4 10
B 1 2003-08-02 30001 3 10
B 2 2004-02-12 20001 2 20
B 3 2004-04-18 30003 3 15
B 4 2004-04-18 30004 3 20
C 1 2003-12-24 10001 1 10
C 2 2004-01-18 10006 1 10
C 3 2004-02-16 20002 2 20
C 4 2004-09-07 30007 3 30