简体   繁体   中英

SQL Select Query giving MISSING EXPRESSION

I am running a query on ORACLE DB 11g and am having an issue:

select ORDER as "_id", * from orderlines;

I have this error:

ORA-00936: missing expression
00936. 00000 -  "missing expression"
*Cause:    
*Action:
Error at Line: 7 Column: 41

I tried it with and without the ; and still gives the error.

Thanks in advance!

As ORDER is a reserved word in many RDBMSs including Oracle, you should escape it with " :

SELECT t."ORDER" AS "_id"
     , t.* 
FROM "orderlines" t

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM