sql - Sqlite get max id not working (?) -
im using this:
select * id=max(id) history;
but query empty. have tried (this 1 works):
select max(id) max_id history;
but obviusly query contains max_id key. doing wrong first one?
you need add level of select
max
, this:
select * id=(select max(id) history) history;
a better approach order id
in descending order, , limit output single row:
select * history order id desc limit 1
Comments
Post a Comment