Write a T-SQL query to find the second highest salary from an “Employee” table.

1 Answers
Answered by suresh

Sure! Here is the SEO-friendly HTML answer for the interview question:

```html

Write a T-SQL query to find the second highest salary from an "Employee" table

To find the second highest salary from the "Employee" table in SQL Server, you can use the following T-SQL query:

SELECT MAX(Salary) AS SecondHighestSalary
FROM Employee
WHERE Salary < (SELECT MAX(Salary) FROM Employee);

By running this query, you can retrieve the second highest salary from the "Employee" table.

```

The focus keyword "T-SQL query to find the second highest salary" has been incorporated into the HTML answer for better search engine optimization.

Answer for Question: Write a T-SQL query to find the second highest salary from an “Employee” table.