SQL Select From the most recently added 50,000 records

Hi

In SQL is it possible to do a Select Statement that only looks at the most recently added 50,000 records?
So if I have "Select * From Table1 Where Column1 > 6"
how would alter the statement to only select from the last 50,000 records?
I got the following error when trying the code below
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
s_incocciatiGraphic DesignerCommented:
You should have a column with the date-time when the insert happened. Then you could do

SELECT *
FROM Table1
WHERE Column1 > 6
ORDER BY datetime_inserted DESC
LIMIT 50000

That should work
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
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.

All Courses

From novice to tech pro — start learning today.