1
在我的表之間的價值觀,我有項(與datetime數據類型)像:錯誤代碼:1064,而試圖獲取時間戳
,我需要一個特定的UNIX時間戳之間產生。當我運行查詢:
Select ifnull(ji.JobID,'') as JobID, ifnull(ji.ReelIndex,'') as ReelIndex, ifnull(ji.FileName,'') as FileName,
ifnull(ji.MediaType,'') as MediaType, ifnull(ji.QCStatus,'') as QCStatus, ifnull(ji.QCComments,'') as QCComments,
ifnull(ji.PackagingStatus,'') as PackagingStatus, ci.Name
from job_info as ji
left join content_info as ci on
ji.ContainerID = ci.ID
where ji.Progress = 100
where ji.ProcessStartTime >= 1449081000
and ji.ProcessEndTime <= 1450549800
order by Name asc, ReelIndex asc
LIMIT 0 , 20
它拋出一個錯誤:
Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where ji.ProcessStartTime >= 1449081000 and ji.ProcessEndTime <= 1450549800 or' at line 4
可能是什麼原因呢?
有沒有辦法,我可以考慮只有日期,而不是時間,而我查詢數據庫? '1449081000'對應於'2015-12-03','1450549800'對應'2015-12-20'。但數據庫也有時間。所以上面的查詢將總是返回一個空集。 –
@SuhailGupta查看已更新。 '1449081000' - >'2015年12月2日18:30:00'因此它也有時間部分 – lad2025
美麗。但我想補充一點,我必須使用'from_unixtime(1449081000)',這樣我才能看到結果! –