Justin writes "If I have a table with data as so:-Item Location Qty DateApple Bedroom 3 12/31/2001 12:00:00Orange Closet 18 11/05/2001 15:34:00Banana Kitchen 59 01/28/2002 15:04:00Apple Kitchen 3 01/01/2002 02:00:00Banana Cellar 53 02/01/2002 18:04:00Apple Bathroom 2 02/01/2002 14:31:00
Can I create a single SQL query to return all columns with just the latest date for the Item?That is, I only want to see the following:-Item Location Qty DateOrange Closet 18 11/05/2001 15:34:00Apple Bathroom 2 02/01/2002 14:31:00Banana Cellar 53 02/01/2002 18:04:00
I was thinking of 2 queries - SELECT DISTINCT Item then stick it in an array, then for each array element pull out the latest date. But thats too slow . . .ps/ I'm using Windows 2000 and SQL Server 7"