📜  sql select second max - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:26.079000             🧑  作者: Mango

代码示例1
Both options you find max as a subset and then exclude from main select
sql> SELECT MAX( col ) FROM table
     WHERE col < ( SELECT MAX( col ) FROM table);
sql> SELECT MAX(col) FROM table 
WHERE col NOT IN (SELECT MAX(col) FROM table);