mysql - SQL inner join same table to get max value -
i have table "tbltrasaction". used following code max date:
select max(t.trandate) tbltrasaction
then want use max date value max transaction id,i used following code:
select max(t.trandate) tbltrasaction t inner join ( select max(t.tranid) tbltrasaction t ) temp on temp.tranid =t.tranid
but fail result, how fix it? thanks
isn't way,
select max(tranid) tranid tbltrasaction trandate = (select max(trandate) tbltrasaction)
Comments
Post a Comment