Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assuming there is a timestamp column in the MySQL table that records the date and time when the news item was added, the method for choosing news from the past 6 months is:

SELECT * FROM news_table
WHERE timestamp_column >= DATE_SUB(NOW(), INTERVAL 6 MONTH);

This SQL query selects all columns (*) from the news_table where the value of the timestamp_column is greater than or equal to (>=) the current date and time minus (DATE_SUB) 6 months (INTERVAL 6 MONTH). The NOW() function returns the current date and time.