sql之查询子临时表在使用时要加别名

select(
if(
(select count(e.Salary) from (select distinct e.Salary from Employee e) e)>=N,

        (
        select min(e.Salary)
            from (select distinct e.Salary from Employee e order by e.Salary desc limit N) e
        )
        ,
        null
    )
 )

上面sql语句中 e 是必须的

猜你喜欢

转载自blog.csdn.net/qq_31476455/article/details/90024520