sql - Syntax error in Postgres query -


i written select query in postgresql db giving me syntax error.

select order.c_doctype_id , doc.docsubtypeso  c_order order      inner join c_doctype doc on(order.c_doctype_id = doc.c_doctype_id) order.c_order_id =1000674 

in above query giving me syntax error near order.

use double quotes "" reserved words :

select "order".c_doctype_id , doc.docsubtypeso  c_order "order" inner join c_doctype doc on("order".c_doctype_id = doc.c_doctype_id) "order".c_order_id =1000674 

or don't use reserved words:

select o.c_doctype_id , doc.docsubtypeso  c_order o inner join c_doctype doc on(o.c_doctype_id = doc.c_doctype_id) o.c_order_id =1000674 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -