How can I make a table in MySQL called "order"?

can you use something like?

select * from `order`

I got here because I was searching for similar solution for SQL CE. There using order 'order' "order" doesn't work. What worked was: [order] Maybe it'll help someone else also.


The word order is actually an SQL keyword. You would have the same problem if you tried to use a table called group or select. You can fix it is MySQL by using quotes around it, along the lines of:

select f1, f2 from `order` where blah blah blah ...

However, unless your table will only ever hold a single order (in which case it won't do so for long since the underlying business will soon be bankrupt), you should probably call your table orders.

That solves both your problems, the one you found and the one you didn't :-)

Tags:

Mysql