A simple mysql command to see records that have been processed in the last 6 months
SELECT * FROM records
WHERE date >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH);
This query uses the CURDATE() function to get the current date, and then subtracts 6 months from it using the DATE_SUB function. The result is used as the lower bound for the date column in the WHERE clause, ensuring that only records with a date within the last 6 months will be selected.
Top comments (0)