ramesh_iridium Posted July 14, 2008 Share Posted July 14, 2008 HI How to select highest 3 salaries from a table ? Please give your solutions ... Ramesh Quote Link to comment Share on other sites More sharing options...
Xurion Posted July 14, 2008 Share Posted July 14, 2008 SELECT salary FROM salaries ORDER BY salary LIMIT 3 Quote Link to comment Share on other sites More sharing options...
fenway Posted July 14, 2008 Share Posted July 14, 2008 You're missing "DESC". Quote Link to comment Share on other sites More sharing options...
Xurion Posted July 15, 2008 Share Posted July 15, 2008 Doesn't it do that automatically? Quote Link to comment Share on other sites More sharing options...
fenway Posted July 15, 2008 Share Posted July 15, 2008 Doesn't it do that automatically? No -- why would it? It defaults to ASC, but you should never rely on this. Always ask for what you want explicitly -- no suprises. Quote Link to comment Share on other sites More sharing options...
Xurion Posted July 16, 2008 Share Posted July 16, 2008 Sorry wasn't thinking straight yesterday - for some reason I assumed it sorted the other way around by default =_= I agree with Fen, you should specify for no unexpected results. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.