看看我的查询有一个语法错误:
SELECT min(t.`status`) ,
t.`moddate`,case @rownum when 1 then
@rowdate := @rowdate
@rownum+1
else
@rowdate := ((@rowdate + INTERVAL @timediff SECOND) - INTERVAL @timediff SECOND)
end
FROM (SELECT `status`,`moddate`
FROM `globstats_graph`
WHERE Cname='Cpmtree' AND IP='69.64.83.236'
AND Port='3306' AND Variable='TABLE_LOCKS_IMMEDIATE'
AND moddate between '2015-01-01 00:00' and '2015-02-01 00:00') t
,(
SELECT @rowdate :='2015-01-01 00:00',SELECT @timediff :=ROUND((TIMESTAMPDIFF(SECOND,'2015-01-01 00:00','2015-02-01 00:00')/90)),@rownum:=1
) AS r, GROUP BY case @rownum when 1 then
@rowdate := @rowdate
@rownum+1
else
@rowdate := ((@rowdate + INTERVAL @timediff SECOND) - INTERVAL @timediff SECOND)
end
你能不能请任何人建议我出了什么问题。