Reputation: 727
I am newbie in postgres. I have a query
SELECT * FROM orders
LEFT OUTER JOIN order_details ON order_details.orderid= orders.orderid
an it get error
SQL error:
ERROR: column order_details.orderid doesn't exist
LINE 2: LEFT OUTER JOIN order_details ON order_details.orderid...
^
In statement:
SELECT COUNT(*) AS total FROM (SELECT * FROM orders
LEFT OUTER JOIN order_details ON order_details.orderid= orders.orderid) AS sub
What am i missing in my query? Thanks before
Upvotes: 2
Views: 1804
Reputation: 1090
Postgres is case sensitive. Your SQL statement must be in the correct case, and if the table name or column name is not lower case then you must enclose it in double quotation marks. (as shown below)
SELECT * FROM orders
LEFT OUTER JOIN order_details ON order_details."OrderID"= orders.orderid
Upvotes: 2