mysql>select now()
+---------------------+
| now() |
+---------------------+
| 2010-08-25 09:34:41 |
+---------------------+
1 row in set (0.00 sec)
mysql>select date_add(now(),interval -1 year)
+----------------------------------+
| date_add(now(),interval -1 year) |
+----------------------------------+
| 2009-08-25 09:34:44 |
+----------------------------------+
1 row in set (0.00 sec)
mysql>select date_sub(now(),interval 1 year)
+---------------------------------+
| date_sub(now(),interval 1 year) |
+---------------------------------+
| 2009-08-25 09:34:46 |
+---------------------------------+
1 row in set (0.00 sec)
mysql>
首先明确概念:环比增长率=(本期数-上期数)/上期数*100% 反映本期比上期增长了多少。
同比增长率=(本期数-同期数)/同期数*100% 指和去年同期相比较的增长率。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)