6

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 schema, it's a table!

Jasper Kennis
  • 3,225
  • 6
  • 41
  • 74
Jaanus
  • 16,161
  • 49
  • 147
  • 202

1 Answers1

11

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'