_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › れ谿剰鍵

declare @search_number int
set @search_number = 99 --谿場 螳 99朱..

;with dummy
as
(
        select 0 seq
        union all
        select seq + 1 from dummy
        where seq + 1 <= 1000
)
select 
	case when sign(seq - @search_number) > 0 then 'next' else 'prev' end as dir,
	case when sign(seq - @search_number) > 0 then min(seq) else max(seq) end as seq 
from dummy
where seq <> @search_number
group by sign(seq - @search_number)
order by sign(seq - @search_number)
option (maxrecursion 0);
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:52

蠏碁所 ロ 讌 襷 碁襯 襴糾 襷 . (れ梗)