2015-02-24 37 views
0

我有一張表,其中每行在date列和帶日期和索引的另一個表上進行了時間戳記。MYQSL-如何使用日期索引

該表有兩列:dateindex

我得到語法錯誤每次我嘗試:

select index from date_index where 'any where condition' 

我得到任何錯誤:

select * from date_index 

我得到的語法錯誤有:

select date,index from date_index 

爲什麼?

回答

1

使用反引號逃脫的MySQL reserved words用作標識符:

SELECT date, `index` FROM date_index 
+0

PFF。菜鳥的錯誤。謝謝!! – mawena 2015-02-24 21:15:33