Write a SQL query to get the second largest AvgMark from the “Student” table. You are NOT allowed to use row_number(), rownum or rank() or limit.
时间: 2024-02-23 07:02:08 浏览: 79
Sure, here's a SQL query to get the second largest AvgMark from the “Student” table without using row_number(), rownum, rank() or limit:
```
SELECT MAX(AvgMark) AS SecondLargestAvgMark
FROM Student
WHERE AvgMark <
(SELECT MAX(AvgMark) FROM Student)
```
This query first finds the maximum AvgMark in the Student table using a subquery, and then selects the maximum AvgMark that is less than the maximum AvgMark found in the subquery. This will give us the second largest AvgMark in the table.
阅读全文