VasuSidhu
asked on
SQL Server 2008
I have a table in sql with 3 columns.
File# Status Exportdate
1 a 1-Jul
1 s 9-Jul
1 d 11-Jul
1 f 13-Jul
1 g 15-Jul
1 h 10-Aug
1 j 20-Aug
2 f 2-Jul
2 a 11-Jul
2 s 31-Jul
2 d 9-Aug
I want the status of the file having last date.
for eg the output of the query should be
File# Status ExportDate
1 j 20-Aug
2 d 9-Aug
File# Status Exportdate
1 a 1-Jul
1 s 9-Jul
1 d 11-Jul
1 f 13-Jul
1 g 15-Jul
1 h 10-Aug
1 j 20-Aug
2 f 2-Jul
2 a 11-Jul
2 s 31-Jul
2 d 9-Aug
I want the status of the file having last date.
for eg the output of the query should be
File# Status ExportDate
1 j 20-Aug
2 d 9-Aug
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT TOP 2 * FROM table order by Exportdate desc
sorry I did it wrong