Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

I am looking for a where clause that can be used to retrieve records for the last 24 hours?

1 Answer

0 votes
by (40.7k points)

Try using below code:

SELECT * 

FROM table_name

WHERE table_name.the_date > DATE_SUB(CURDATE(), INTERVAL 1 DAY)

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...