+ -
当前位置:首页 → 问答吧 → 求存储过程

求存储过程

时间:2011-09-10

来源:互联网

在mysql存储过程中如何把得到的系统时间转化成整行。例如:2011-09-10 18:27:36 转化为 20110910182736

作者: zhangna08   发布时间: 2011-09-10

SQL code
mysql> Select date_format('2011-09-10 18:27:36','%Y%m%d%H%i%s');
+---------------------------------------------------+
| date_format('2011-09-10 18:27:36','%Y%m%d%H%i%s') |
+---------------------------------------------------+
| 20110910182736                                    |
+---------------------------------------------------+
1 row in set (0.22 sec)

mysql>

作者: ACMAIN_CHM   发布时间: 2011-09-10

mysql>Select date_format(now(),'%Y%m%d%H%i%s');
+-----------------------------------+
| date_format(now(),'%Y%m%d%H%i%s') |
+-----------------------------------+
| 20110910193926 |
+-----------------------------------+
1 row in set (0.00 sec)

作者: rucypli   发布时间: 2011-09-10

mysql>Select date_format(now(),'%Y%m%d%H%i%s');
+-----------------------------------+
| date_format(now(),'%Y%m%d%H%i%s') |
+-----------------------------------+
| 20110910193926 |
+-----------------------------------+
写个存储过程 调用下 看看返回的是int 型吗?

作者: zhangna08   发布时间: 2011-09-10