Avatar of VasuSidhu
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
Microsoft SQL Server 2008Microsoft SQL ServerMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
Metehan Ozcullu

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Patrick Matthews

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Metehan Ozcullu

SELECT TOP 2 * FROM table order by Exportdate desc
Metehan Ozcullu

sorry I did it wrong
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck