首页 > 代码库 > MySQL 内建函数
MySQL 内建函数
日期相关
mysql> select curdate(),curtime(),now(),unix_timestamp(),week(‘2017-07-24‘),year(‘2017-07-24‘),hour(‘16:15:11‘),date_format(‘2017-07-24‘,‘%m-%d,%y‘); +------------+-----------+---------------------+------------------+--------------------+--------------------+------------------+--------------------------------------+ | curdate() | curtime() | now() | unix_timestamp() | week(‘2017-07-24‘) | year(‘2017-07-24‘) | hour(‘16:15:11‘) | date_format(‘2017-07-24‘,‘%m-%d,%y‘) | +------------+-----------+---------------------+------------------+--------------------+--------------------+------------------+--------------------------------------+ | 2017-07-24 | 16:18:37 | 2017-07-24 16:18:37 | 1500884317 | 30 | 2017 | 16 | 07-24,17 | +------------+-----------+---------------------+------------------+--------------------+--------------------+------------------+--------------------------------------+ 1 row in set (0.00 sec)
其他常用
mysql> select database(),version(),user(),inet_aton(‘118.11.22.33‘),password(‘1‘),md5(‘1‘); +------------+------------+----------------+---------------------------+-------------------------------------------+----------------------------------+ | database() | version() | user() | inet_aton(‘118.11.22.33‘) | password(‘1‘) | md5(‘1‘) | +------------+------------+----------------+---------------------------+-------------------------------------------+----------------------------------+ | NULL | 5.6.34-log | root@localhost | 1980438049 | *E6CC90B878B948C35E92B003C792C46C58C4AF40 | c4ca4238a0b923820dcc509a6f75849b | +------------+------------+----------------+---------------------------+-------------------------------------------+----------------------------------+ 1 row in set (0.00 sec)
MySQL 内建函数
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。