美文网首页
mysql取年、月、日、时间

mysql取年、月、日、时间

作者: 努力与幸运 | 来源:发表于2019-02-21 17:21 被阅读2次

select id, phone,time,year(time),month(time), DAY(time),TIME(time) from user where phone='xxxxxx' #分别取年、月、日、时间
select id, phone,time from user where phone='xxxxxx' #
select id, phone,time,year(time) from user where phone='xxxxxx' #分别取年
select id, phone,time,month(time) from user where phone='xxxxxx' #分别取月
select id, phone,time,DAY(time) from user where phone='xxxxxx' #分别取日
select id, phone,time,TIME(time) from user where phone='xxxxxx' #分别取时间

相关文章

网友评论

      本文标题:mysql取年、月、日、时间

      本文链接:https://www.haomeiwen.com/subject/syddyqtx.html