我試圖運行該SQL查詢:找不到SQL語法錯誤
SELECT avg(response_seconds) as s FROM
(select time_to_sec(timediff(from_unixtime(floor(UNIX_TIMESTAMP(u.datetime)/60)*60), u.datetime))) as response_seconds
FROM tickets t JOIN ticket_updates u ON t.ticketnumber = u.ticketnumber
WHERE u.type = 'update' and t.customer = 'Y' and DATE(u.datetime) = '2016-04-18'
GROUP BY t.ticketnumber)
AS r
,但我看到這個錯誤:
#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 'FROM tickets t JOIN ticket_updates u ON t.ticketnumber = u.ticketnumber WHE' at line 3
,我不能工作了錯誤所在查詢
什麼SQL? SQL Server?更新您的標籤。 –
編輯的問題:) – charlie
看起來像你在'as response_seconds'之前太早關閉''''。這屬於'(select ...)'內部,但你在外面。 「在FROM附近使用正確的語法」意味着您必須立即查看該問題才能找到問題。 –