2011-04-29 12 views
6

¿Cómo puedo hacer que esta consulta funcione?¿Por qué Postgresql dice "el esquema no existe"

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" no existe.

el tiempo no es un esquema, es una tabla!

Respuesta

8

quizá:

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 se queja de la unión en weather.city_id que se interpreta como una tabla/vista llamada 'city_id' en el esquema de 'tiempo'

Cuestiones relacionadas