2011-04-29 42 views
6

我該如何得到這個查詢的工作?Postgresql爲什麼說「架構不存在」

SELECT weather.id, cities.name, weather.date, weather.degree 
FROM weather JOIN weather.city_id ON cities.id 
WHERE weather.date = '2011-04-30'; 

錯誤:架構「天氣」不存在。

天氣不是模式,它是一張桌子!

回答

8

也許是:

SELECT weather.id, cities.name, weather.date, weather.degree 
FROM weather JOIN cities ON (weather.city_id = cities.id) 
WHERE weather.date = '2011-04-30'; 

Postgres的抱怨聯接上weather.city_id這被解釋爲在模式「天氣」

稱爲「city_id」表/圖
相關問題