This sql command works fine in sqlitemanager
but in my android application this don’t sort desc…
select t._id, u.name, c.commdate, c.message
from tickets t, users u, comments c
where c.userid = u._id and c.ticketid = t._id
and t.status = 5
group by t._id
having max(c.commdate)
order by c.commdate desc
I have a feeling the “having” part is a problem. Try (untested);