I have a table which stores historical temperatures for the past 5 days stored in an integer[] column based on city. The question is: How can I query for entries which have a value great than or less than a specified value? Here's an example table:
+=========+==================+
| city | temps |
+=========+==================+
| Seattle | {65,72,63,56,72} |
+---------+------------------+
| Miami | {83,75,69,72,79} |
+---------+------------------+
Let's say I want to query for cities which have experienced a temp higher than 80. In this example only Miami has experienced temps higher than 80, so only that row should be returned. I've tried a few queries with no success, looked into intarray, but that doesn't seem to solve my problem either. Thanks much!
I'm running PostgreSQL 9.1