I have a query with a result like this
No date No.PO product type div price
1. 01-10-2012 | AAA1 | X1 | 1 | SBS | 100
2. 09-10-2012 | ABA1 | X1 | 2 | SBS | 150
3. 11-10-2012 | ACC1 | X1 | 1 | SBS | 110
4. 15-10-2012 | ACD1 | X1 | 1 | DBS | 115
5. 20-10-2012 | ADA1 | X1 | 1 | SBS | 112
6. 23-10-2012 | AFA1 | X1 | 2 | SBS | 160
7. 27-10-2012 | AHA1 | X1 | 1 | SBS | 120
and a few thousand record . . .
and the result should be show like this
No date No.PO product type div price
1. 27-10-2012 | AHA1 | X1 | 1 | SBS | 120
2. 23-10-2012 | AFA1 | X1 | 2 | SBS | 160
3. 15-10-2012 | ACD1 | X1 | 1 | DBS | 115
Here is the rules
- Distinct on product type and div
- Only the last transaction that i wanna show (it means the biggest date among the duplicate product, type and div data)
- All of the field (date, No.PO, product, type, div and price) must be showed
Hopefully my description is clear now . .
Anyone can help me with the right query?
Please try the query and check the result, mere guess.