mysql取年、月、日、时间

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'                      #分别取时间

posted @ 2016-10-16 11:44  Xiao|Deng  阅读(60774)  评论(0编辑  收藏  举报