Question
SQL Question
I have a table that contains this data/layout :
San Francisco PO-12345 5/10/2008
San Francisco PO-98734 4/13/2008
Seattle PO-38484 4/28/2008
San Diego PO-98149 5/23/2008
San Diego PO-52221 5/20/208
San Diego PO-00973 5/16/2008
What I need to do is to find the last record (order by date desc) for each city. For example, I need to get this
data into a view to be used later on :
San Francisco PO-12345 5/10/2008
Seattle PO-38484 4/28/2008
San Diego PO-98149 5/23/2008
I can find one record at a time using select top 1 and order by date desc, but how do I find the last record for all the cities ?
San Francisco PO-12345 5/10/2008
San Francisco PO-98734 4/13/2008
Seattle PO-38484 4/28/2008
San Diego PO-98149 5/23/2008
San Diego PO-52221 5/20/208
San Diego PO-00973 5/16/2008
What I need to do is to find the last record (order by date desc) for each city. For example, I need to get this
data into a view to be used later on :
San Francisco PO-12345 5/10/2008
Seattle PO-38484 4/28/2008
San Diego PO-98149 5/23/2008
I can find one record at a time using select top 1 and order by date desc, but how do I find the last record for all the cities ?
