I have a table structure as follows:
measurements: id | Value | sensor_id Now I have another table called sensors where
sensors: id | Name | provider_id Then I have another table called Providers as:
providers: id | Name Now what I want to do is select all the records from the measurements table where the sensor_ID has a particular type (specified by an ID).
So I did something like:
select * from measurements, sensors, providers JOIN sensors on sensors.id = measurements.sensor_id JOIN providers on providers.id = sensor.provider_id where provider.id = 1 LIMIT 100 However, this comes back with There is an entry for table "sensor_measurements", but it cannot be referenced from this part of the query. I have tried other kind of variants on this but could not get it to work.
I am using Postgresql and using the PgAdmin tool.