我是postgres的新手。我有一个查询
SELECT * FROM orders
LEFT OUTER JOIN order_details ON order_details.orderid= orders.orderid
它得到错误
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
我的查询中缺少什么? 先谢谢
答案 0 :(得分:2)
Postgres区分大小写。您的SQL语句必须是正确的情况,如果表名或列名不是小写,则必须用双引号将其括起来。 (如下图所示)
SELECT * FROM orders
LEFT OUTER JOIN order_details ON order_details."OrderID"= orders.orderid