从table中取得工资最高员工的信息。
这道题目很简单,我个人想了两种实现方法,但还是不觉得简单,不知道高手有没有其它好的方案?
1
select top 1 * from table
order by salary desc;
2
select * from table
where salary=(select max(salary) from table );
...全文
109025打赏收藏
一道简单的sql面试题:取得工资最高员工信息,求最佳答案
从table中取得工资最高员工的信息。 这道题目很简单,我个人想了两种实现方法,但还是不觉得简单,不知道高手有没有其它好的方案? 1 select top 1 * from table order by salary desc; 2 select * from table where salary=(select max(salary) from table );