mawena
mawena

Reputation: 1

MySQL- How to use a date index

I have a table where each row is time-stamped on a date column and another table with dates and indexes.

The table has two columns: date and index.

I get syntax error every time I try:

select index from date_index where 'any where condition'

I get no error with:

select * from date_index

I get syntax error with:

select date,index from date_index

Why?

Upvotes: 0

Views: 56

Answers (1)

Marcus Adams
Marcus Adams

Reputation: 53880

Use backticks to escape MySQL reserved words used as identifiers:

SELECT date, `index` FROM date_index

Upvotes: 1

Related Questions