abes_nitya Posted September 9, 2006 Share Posted September 9, 2006 plz help me.... I want to find" top 5 sal from emp" how can we find???thanks. Link to comment Share on other sites More sharing options...
skym Posted September 9, 2006 Share Posted September 9, 2006 In mysql the query would be:SELECT sal FROM emp ORDER BY sal DESC LIMIT 5 Link to comment Share on other sites More sharing options...
bhavik_solanki Posted September 14, 2006 Share Posted September 14, 2006 plz help me.... I want to find" top 5 sal from emp" how can we find???thanks.In SQL server u can try this querySelect Distinct Top 2 salary from EmpSalary Order by salary Desc Link to comment Share on other sites More sharing options...
Raj Ali Posted September 20, 2006 Share Posted September 20, 2006 In SQL server u can try this querySelect Distinct Top 2 salary from EmpSalary Order by salary DescYou use the querySelect top 5 salary from <table name> Link to comment Share on other sites More sharing options...
aspnetguy Posted September 20, 2006 Share Posted September 20, 2006 You use the querySelect top 5 salary from <table name> No that will give you the first 5 records, if you are looking for the 5 highest salaries it would beMYSQLSELECT * FROM emp ORDER BY sal DESC LIMIT 5 SQL Server/Access SELECT TOP 5 * FROM emp ORDER BY sal DESC Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now