MySql, combining date and time column into a time stamp

前端 未结 6 1340
孤城傲影
孤城傲影 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 14:58

    If it possible to use built-in function, just use it. Any way here is an example to find records between given timestamps.

    SELECT `id` FROM `ar_time` WHERE TIMESTAMP(`cdate`,`ctime`) BETWEEN fromTimeStamp AND nowTimeStamp;
    

提交回复
热议问题