How to get data one year before till now from database in mysql?
by Lalita
0 2913
Answer: To select all records one year ago till today, first of all you have to get the current date for comparing the year with date in your database.
SELECT * FROM users WHERE join_date >= DATE_SUB(NOW(),INTERVAL 1 YEAR);

Share:
Recommended Topics:
You May Also Like
PHP Examples
News letter
Subscribe To Never Miss an Article From
Comments
Waiting for your comments