Hello. I currently have a database table with thousands of news from different dates. I would like to create a query that brings me the news by days and by month, but not by year. For example, the news of July 4 from different years. Thank you for your help.
Discussion posts and replies are publicly visible
You can create a query to bring news by day and by month, but not by year, by using the "GROUP BY" clause in SQL. Here's an example using MySQL:
SELECT DAY(date_column) AS day, MONTH(date_column) AS month, COUNT(*) AS total FROM your_table GROUP BY DAY(date_column), MONTH(date_column) ORDER BY month, day
In this example, date_column is the name of the column in your database table that stores the dates of the news. The query first extracts the day and month from each date in the date_column using the DAY and MONTH functions, respectively geometry dash lite. The GROUP BY clause then groups the data by the extracted day and month, and the COUNT function counts the number of news for each group. The query results will be ordered by the month and day.
date_column
DAY
MONTH
GROUP BY
COUNT