StellaIndigo
IS-IT--Management
I have a table,
order_number (number)
status_code (number)
date_of_status (date/time)
An order_number can have several entries for each time the status code is updated/progressed so, for example,
000001,100,10/11/2003 11:00:00
000001,101,10/11/2003 11:20:00
000001,102,12/11/2003 17:45:00
000222,100,11/11/2003 09:14:00
000222,104,12/11/2003 11:10:00
000222,109,17/11/2003 12:01:00
I want to query the table but one return the very latest entry for each order number, so the query would return,
000001,102,12/11/2003 17:45:00
000222,109,17/11/2003 12:01:00
I've indexed the table on order_number + status_code + date_of_status <--(decending) but it don't work.
Can any one point me in the right direction.
Ta.
There are 10 types of people in the world. Those that understand binary and those that don't.
order_number (number)
status_code (number)
date_of_status (date/time)
An order_number can have several entries for each time the status code is updated/progressed so, for example,
000001,100,10/11/2003 11:00:00
000001,101,10/11/2003 11:20:00
000001,102,12/11/2003 17:45:00
000222,100,11/11/2003 09:14:00
000222,104,12/11/2003 11:10:00
000222,109,17/11/2003 12:01:00
I want to query the table but one return the very latest entry for each order number, so the query would return,
000001,102,12/11/2003 17:45:00
000222,109,17/11/2003 12:01:00
I've indexed the table on order_number + status_code + date_of_status <--(decending) but it don't work.
Can any one point me in the right direction.
Ta.
There are 10 types of people in the world. Those that understand binary and those that don't.