Because you are asking for the value of something called "myValue" and the other query's do not return anything called "myValue". Try something like: select max(myValue) AS myValue from myTable; If you want to access the result using the name "myValue" ...