Skip to content
Advertisement

SQL and Jython – selecting MAX value in COLUMN

I’m trying to get the max value from a column in a table.

When I have MAX in the SQL query I get an error:

But when I leave out MAX in the SQL query I get the first value in the column, which also corresponds to the MIN value. I’m pretty new to Jython/Java so I’m not really sure why this is happening or how to resolve the issue. Any help would be much appreciated!

Advertisement

Answer

Just alias the column name:

You can then refer to the alias in the resultset:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement