Oracle: 11gR2
Windows 7 client
I have a data set (result of a query) which is similar to:
D_rank product_id product_desc category price revenue cost
1 112233 prod1-iphone phone 200 500 100
1 112233 prod1-iphone4 phone 200 500 100
2 223344 prod2-windows7 OS 300 1000 400
2 223344 prod2-windows7 software 300 1000 400
3 334455 prod3-Mac computer 1000 1500 1000
4 445566 prod4-xyz misc 2000 800 1200
: : : : : : :
: : : : : : :
: : : : : : :
As you can notice from first 4 rows, because of the product_desc and category field these ranks are repeated. I need these fields but the first value from each sub-group, so that every rank is unique. I.e.
D_rank product_id product_desc category price revenue cost
1 112233 prod1-iphone phone 200 500 100
2 223344 prod2-windows7 OS 300 1000 400
3 334455 prod3-Mac computer 1000 1500 1000
4 445566 prod4-xyz misc 2000 800 1200
: : : : : : :
: : : : : : :
: : : : : : :
Will appreciate some help.