i am using H2-DB to access static databases...
i have a table which looks like:
COUNTRY STATE CITY LAT LNG COUNTRYID S
MySQL is broken in regards to this. It allows columns in the GROUP BY
that are neither in the group by
nor arguments to aggregation functions. In fact, the documentation warns against using this extension.
So you can do:
SELECT state
FROM DIYANET
WHERE COUNTRY = 'Germany'
GROUP BY STATE
ORDER BY STATE;
Or something like this:
SELECT state, min(city), min(lat), . . .
FROM DIYANET
WHERE COUNTRY = 'Germany'
GROUP BY STATE
ORDER BY STATE;
But SELECT *
is not allowed and doesn't really make sense.