Based upon Fim's OP, I understood that he wanted to pull a single temperature value from a specific row, but have SQL compare the value to a min and max value (that is known in the code, not the database) and return the comparison results.

If the intention is to pull the MIN and MAX values from a range of rows, there is definitely a more efficient way to do it using SQLite's MIN() and MAX() functions.