• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 141
  • Last Modified:

SQL question (How to get the latest)

Hi
   I have the following SQL and it returns many file names.
How do i get the one which has the latest creation_date which is a field
in the premade_zip_files table.

thanx

select file_id
from   premade_zip_files
where  file_name = 'blabla'
0
b3cf
Asked:
b3cf
  • 2
1 Solution
 
Mikal613Commented:
select TOP 1 file_id
from   premade_zip_files
where  file_name = 'blabla'  
ORDER BY  creation_date  
0
 
Mikal613Commented:
select TOP 1 file_id
from   premade_zip_files
where  file_name = 'blabla'  
ORDER BY  creation_date  DESC
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now