題目:
答案:
1
筆記:
# Write your MySQL query statement below
select IFNULL((select Distinct Salary from Employee order by Salary DESC limit 1,1),null) as SecondHighestSalary
2# Write your MySQL query statement below
select max(Salary) as SecondHighestSalary from Employee where Salary<(select max(Salary) from Employee)
筆記:
LIMIT:
select * from Customer LIMIT 10;--檢索前10行數據,顯示1-10條數據
select * from Customer LIMIT 1,10;--檢索從第2行開始,累加10條id記錄,共顯示id爲2....11
select * from Customer limit 5,10;--檢索從第6行開始向前加10條數據,共顯示id爲6,7....15
select * from Customer limit 6,10;--檢索從第7行開始向前加10條記錄,顯示id爲7,8...16
select * from Customer LIMIT 1,10;--檢索從第2行開始,累加10條id記錄,共顯示id爲2....11
select * from Customer limit 5,10;--檢索從第6行開始向前加10條數據,共顯示id爲6,7....15
select * from Customer limit 6,10;--檢索從第7行開始向前加10條記錄,顯示id爲7,8...16