You are viewing a single comment's thread from:
RE: 软件工程师数据库面试技巧之 SQL中的第二名记录 Software Engineer Interview Question - The Second Highest
但是当第二高记录不存在时, 该SQL返回空而不是 null.
刚试了一下,用 group + order
select Salary as SecondHighestSalary from Employee group by Salary order by Salary limit 1,1
Input: {"headers": {"Employee": ["Id", "Salary"]}, "rows": {"Employee": [[1, 100]]}}
Output: {"headers": ["SecondHighestSalary"], "values": []}
Expected: {"headers": ["SecondHighestSalary"], "values": [[null]]}
嗯就是没有记录吧
你过的是英国的时间么?天天晚睡,记得保养啊
我是真的睡不着。。。。我也没办法。。。
你男人呢?
他也是睡眠不规律。不过他比我入睡更容易一些。