标签:win sel max sele min name oal coalesce where
select e.ename,e.sal,
coalesce(
(select min(sal) from emp d where d.sal>e.sal),
(select min(sal) from emp)
) as forware,
coalesce(
(select max(sal) from emp d where d.sal<e.sal),
(select max(sal) from emp)
) as rewind
from emp e
order by 2;
标签:win sel max sele min name oal coalesce where
原文地址:http://www.cnblogs.com/liang545621/p/7523405.html