Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@morningdot-6Xuj4M • Apr 10, 2011
No answer !! -
@prasad-aSUfhP • Apr 11, 2011
in mysql, you have the LIMIT keyword, sort by the primary key in desc order and use LIMIT 10. that should do no? -
@morningdot-6Xuj4M • Apr 11, 2011
I have tried
select * from table order by id desc limit 10;
and
select * from table order by id limit 10;
both but it doesn't works !! -
@slashfear-tSWzpz • Apr 12, 2011
Hey Mohit,
Can you specify what database your using because what kidakaka said is right !! in Mysql it will work!! if your using any other database for example in Microsoft SQLserver or SYBASE, LIMIT keyword is not supported so we have to use TOP keyword (mostly in databases it will either support TOP or LIMIT will be available) so this is how you can use your TOP keyword to accomplish the task what you asked for EG: select top 10 * from tablename order by id desc
-Arvind