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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -