0

I'm new to ActiveJDBC and Java. How can I do

SELECT MAX(age) FROM persons

with ActiveJDBC on a MySQL database?

I have tried

Pesrsons.find("MAX(age)")

but this one returns an empty list and

Persons.FindBySql("SELECT MAX(age) FROM persons")

this other one returns null. Any idea?

pomalo
  • 13
  • 2

1 Answers1

2

You can't use .find() to execute a custom "SELECT" query.

But with .findBySql() this should work Persons.FindBySql("SELECT MAX(age) as age FROM persons")