Updated get_readings query

Changed to use JOIN.