Hello, I have already searched here, but I did not...
# exposed
m
Hello, I have already searched here, but I did not find an answer. How can I build a sql via DSL or Dao that looks like this:
select count(ID) from employer
The ID column is primary key, so uniq and has no nulls.
Employer.slice(Employer.Id).count()
produces
select count(*) from employer
Thanks!
t
Employer.slice(Employer.Id).selectAll()
m
Thank you @tapac! Now I see I made a mistake in the question - I forgot the count(). I want to know how many rows has the table and want to use only the column that have the primary key (not over all with the star). Is there a way to make it?
t
I think you can try to adjust a query from a wiki
a
+1 -- did you figure this out?