Reputation: 21
how to achieve this without using nested query or sub query.
select * from table_name where id=(select avg(id) from table_name);
need some suggestion.
Upvotes: 1
Views: 62
Reputation: 1766
How about
SELECT * FROM table_name ORDER BY id DESC LIMIT 1
Upvotes: 0
Reputation: 3572
select * from table_name order by id desc limit 1
Upvotes: 3