MySql, combining date and time column into a time stamp

前端 未结 6 1346
孤城傲影
孤城傲影 2020-12-14 14:32

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 th

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 15:08

    Or you could use the built-in TIMESTAMP(date,time) function.

    So then you would do something like this say from an Orders table...

    SELECT OrderNumber, TIMESTAMP(date,time) as OrderTS, SalesPersonID
    FROM Orders
    

提交回复
热议问题