how to get second highest salary department wise without using analytical functions?

前端 未结 11 1863
孤独总比滥情好
孤独总比滥情好 2021-01-06 03:08

Suppose we have 3 employees in each department.we have total 3 departments . Below is the sample source table

Emp deptno salary
A    10     1000
B    10              


        
11条回答
  •  再見小時候
    2021-01-06 04:05

    CREATE TABLE Employee
        ([Name] varchar(1), [Dept] varchar(1), [Salary] int)
    ;
    
    INSERT INTO Employee
        ([Name], [Dept], [Salary])
    VALUES
        ('a', 'M', 20),
        ('b', 'M', 25),
        ('c', 'M', 30),
        ('d', 'C', 44),
        ('e', 'C', 45),
        ('f', 'C', 46),
        ('g', 'H', 20)
    

提交回复
热议问题