adspace
1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / rajkumar v
ANS 1:
select p.ColumnName from tablname p group by p.ColumnName
ans2:
Select min(salary)FROM emp WHERE (salary IN (SELECT
TOP 2 salary FROM emp ORDER BY salary DESC))
Or
Select top 1 salary from (select top 2 salary from emp
order by salary desc) emp order by salary
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the kinds of subquery?
Where can you add custom error messages to sql server?
What are different types of constraints?
What is the primary use of the model database?
What is an indexed view?
Explain system functions or built-in functions? What are different types of system functions?
How to convert numeric expression data types using the cast() function?
How to enter binary string literals in ms sql server?
Can one drop a column from a table?
How to connect php with different port numbers?
What is self contained sub query?
do you know how to configure db2 side of the application? : Sql server database administration
Disadvantages of the indexes?
what is the difference between openrowset and openquery?
How to provide default values to function parameters?