MySql,将日期和时间列合并成一个时间戳 [英] MySql, combining date and time column into a time stamp

查看:460
本文介绍了MySql,将日期和时间列合并成一个时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我猜这是比较简单的,但我不确定语法。我有日期和时间列,我想结合到一个时间戳列。我如何使用select来查询?

解决方案

尝试这个

  concat(datefield,'',timefield)as date 


I am guessing this is relatively simple to do, but I am unsure of the syntax. I have date and time columns that I want to combine to a timestamp column. how would I query this using a select?

解决方案

try this

concat(datefield,' ',timefield) as date

这篇关于MySql,将日期和时间列合并成一个时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆