我試圖導入文件後重新排序表,但我對這個查詢得到一個MySQL的語法錯誤:ALTER TABLE ORDER BY STR_TO_DATE和TIME_TO_SEC
ALTER TABLE tablename ORDER BY str_to_date(date, '%m/%d/%Y'), time_to_sec(time) ASC
有人能看到什麼錯呢?這是我得到的錯誤:
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 '(date, '%m/%d/%Y'), time_to_sec(time) ASC' at line 1
實際上我已經在做類似於此的事情,但需要在將數據發送到永久表之前對數據進行排序。在插入聲明中,我在聲明的最後添加了按順序。 – Jubair 2010-12-21 22:59:15