-
Junior Member
needa solution!!!!
hi frends....
i want to calculate the second max sal?
how can i?
can we use 'count' for that?
-
Contributing Member
Re: needa solution!!!!
In SQL server
select max(sal) from employee where sal not in (select max(sal) from employee)
we are using sub queries for this scenario. First of all we are eliminating the record which has the maximum salary. This is done by not in operator. From the rest of the records if we fetch the maximum salary, that is the second highest salary
----------------------
suresh
-
Junior Member
Re: needa solution!!!!
select max(salary) from kani where salary not in
(select top 1 salary from kani order by salary desc)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules