shell - mysql跨年查询
世界只因有你
世界只因有你 2017-04-25 09:02:47
0
1
802

想问问mysql如何查询当季新品销售额的查询的语句,,因为季节会涉及到跨年,,所以很难根据销售日去确定它是不是当季新品的销售。。

世界只因有你
世界只因有你

reply all(1)
漂亮男人

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template