Possible Duplicate:
Are there any reserved words in SQLite?
I have a big database (veekun's pokedex for those who know of it) and one table has a column named "order". It's for sorting purposes, and I'm trying to ORDER BY
that column, but it is a problem since ORDER
is, of course, a reserved word. The two options I see are
So, in the case of 1, how would I go about renaming the column without messing up the database too much? In the case of 2, I can't imagine what I could do, but maybe there's a trick I don't know of to get around this.
I'm using SQLite and PHP.
you just need to surround keyword collisions in `backticks`
Some databases support `
as escape character, others use […]
. Looking up SQLlite's, it supports brackets:
order by [Order]
should work.