Re: how to Replace subquery's with join(min,max)
try this..
/* first */
SELECT t1.*
FROM table1 t1
JOIN ( SELECT MAX(t2.id) AS max_id FROM table1 t2 ) t2
ON t1.id = t2.max_id;
/* second */
SELECT * FROM table1
ORDER BY id DESC
LIMIT 1;
with kind regards,
Thomas
Subject
Views
Written By
Posted
3621
May 10, 2011 09:29AM
Re: how to Replace subquery's with join(min,max)
1528
May 10, 2011 12:01PM
1259
May 11, 2011 02:09AM
1798
May 12, 2011 09:22PM
1204
May 13, 2011 03:04AM
2469
May 19, 2011 06:04AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.