开发者

Why does Postgresql say "schema does not exist"

开发者 https://www.devze.com 2023-03-01 17:42 出处:网络
How can i get this query to work? SELECT weather.id, cities.name, weather.date, weather.degree FROM weather JOIN weather.city_id ON cities.id

How can i get this query to work?

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

ERROR: schema "weather" does not exist.

weather is not s开发者_开发技巧chema, it's a table!


perhaps:

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 is complaining about the join on weather.city_id which is interpreted as a table/view called 'city_id' in schema 'weather'

0

精彩评论

暂无评论...
验证码 换一张
取 消