i have a table called ORDER, when i try to query it using
select * from Order
i get the error 'invalid query' how to do access this table please? thank you
i have a table called ORDER, when i try to query it using
select * from Order
i get the error 'invalid query' how to do access this table please? thank you
Don't ever used reserved words for object (or column) names.
<reserved word>
)If you've inherited such a thing that you are not able to change, then you need to use "quoted identifiers".
I advocate
SELECT *
FROM "Order"
As it is a standard identifier, so will work better across platforms.
ORDER is a reserved word in SQL. Put double quotes around it:
select * from "Order"
And also, I personally think ORDERS is a better name. (Because several orders are stored in the table.)
Late edit: List of reserved words, in different versions of the SQL standard: http://developer.mimer.com/standard/reservedwords/sql-reserved-words.tml
It's generally a good idea to not use reserved words for database object names (tables, views & etc.). Sometimes you just got to deal with it though. The below query should work for you.
select * from [Order]
Just put the brackets around the table name.
Hope this helps!