select DATE_FORMAT(updated_at,'%m') from instances where DATE_FORMAT(updated_at,'%m') between 10 and 12 However, this method is not recommended, because using functions in query conditions will make the query very slow. Generally, in this case, an additional field [quarter] will be created in the table, and this field will be maintained at the same time when the sales date is updated. I have previously done a chart project that collected statistics by hour, morning, afternoon, evening, day, week, month and quarter. Considering the large amount of data, I used another field to maintain it
select DATE_FORMAT(updated_at,'%m') from instances where DATE_FORMAT(updated_at,'%m') between 10 and 12
However, this method is not recommended, because using functions in query conditions will make the query very slow. Generally, in this case, an additional field [quarter] will be created in the table, and this field will be maintained at the same time when the sales date is updated. I have previously done a chart project that collected statistics by hour, morning, afternoon, evening, day, week, month and quarter. Considering the large amount of data, I used another field to maintain it