1
我有時間像前:10.45,13.00 現在我需要檢查在在SQL轉換時間爲timestamp
我的查詢是
SELECT T.*,
(SELECT a.driver_id
FROM tbl_assigned_drivers a
WHERE a.vehicle_id=t.id
AND a.from_time<=T.time
AND a.to_time >=T.time
AND a.status='1') AS driver
FROM
(SELECT id, user_id, stime AS TIME, splace, slat, slng, eplace, elat, elng, status, '1' AS TYPE
FROM `tb_shifts`
UNION ALL SELECT id, user_id, etime AS TIME, eplace AS splace, elat AS slat, elng AS slng, splace AS eplace, slat AS elat, slng AS elng, status, '0' AS TYPE
FROM `tb_shifts`) T,
tb_shft_veh s,
tb_trucks_data t
WHERE T.time>=11.54
AND s.register_number=t.register_number
AND s.register_number='AP01TEST'
AND s.shft_id=T.id
AND s.status='1'
ORDER BY T.time ASC
這裏
a.from_time,a.to_time in format of "YYYY-MM-DD HH:MM:SS"
T.time in format of "HH:MM"
那個時間日期
現在我需要將T.time轉換爲a.from_time格式
請幫幫我...
[標籤:MySQL的]和[標籤:SQL服務器]是兩個完全獨立的RDBMS產品(帶完全不同的日期時間功能)。選一個。 –
其完整的mysql –