Contents

1
2
3 れ姶 覈語 襾豪 覦覯


1 #

磯Μ 譯 1~10, 11 ~ 20, 21 ~ 30 ... 螻 螳 蟲螳 蠏碁9 豌覦螻 . 蠏碁覃 ク蟆 case when num between 1 and 10 .. 螻 螳 case when 讓手 蟆曙郁 襷 . 蟲螳 蠏碁9 る 覩碁 蟲螳 譴螳 蠏 覃 襦螳 る 覩瑚 蠍磯 .(: 1 ~ 10 5) 襷 螳 譟危 覓 螳 讓手旭る 轟壱 蟲螳 螳 覲蟆(1 ~ 10 -> 1 ~ 5, 6 ~10) 螳レ煙 襷れ る 覩語願, 願 螻 讌覲伎 觜朱 覦. 企 覲 豌 貎朱Μ襯 螳螻 . , 襭 螳 蟲螳 螳る 螳襷 .

2 #

declare @unit int;
set @unit = 5 -- 讓手阿

;with samples
as
(
        select 0 rowno
        union all
        select rowno + 1 from samples
        where rowno + 1 <= 1000
)
select  
	convert(varchar(50), (rowno-1) / @unit * @unit + 1) + ' ~ ' + convert(varchar(50), (rowno-1) / @unit * @unit + @unit) width
,	rowno
from samples
option (maxrecursion 0)

3 れ姶 覈語 襾豪 覦覯 #

DW れ姶 覈語 fact 蟲螳 覈 螳蟇一 磯 . 糾 覿覿蟾讌 れ願覃 願姥襦 . ろ蠏碁 蠏碁る慨螻, 蠏覿襯 襷り鍵 襦蠏碁 煙 伎 . 譴 蟆 覩語蟆 襯企 蟆企. 蠏碁 覿襯 覲 覈企朱 蟲螳 蟆 襯 蟆 螳讌螻 螻 れ願 覦覯(願 覿企!) 覃 . 企 襭朱 願屋 螳ロ.
;with samples
as
(
        select 0 rowno
        union all
        select rowno + 1 from samples
        where rowno + 1 <= 10000
)
select  
	convert(varchar(50), (rowno-1) / 1000 * 1000 + 1) + ' ~ ' + convert(varchar(50), (rowno-1) / 1000 * 1000 + 1000) width
,	convert(varchar(50), (rowno-1) / 500 * 500 + 1) + ' ~ ' + convert(varchar(50), (rowno-1) / 500 * 500 + 500) width
,	convert(varchar(50), (rowno-1) / 100 * 100 + 1) + ' ~ ' + convert(varchar(50), (rowno-1) / 100 * 100 + 100) width
,	convert(varchar(50), (rowno-1) / 50 * 50 + 1) + ' ~ ' + convert(varchar(50), (rowno-1) / 50 * 50 + 50) width
,	convert(varchar(50), (rowno-1) / 10 * 10 + 1) + ' ~ ' + convert(varchar(50), (rowno-1) / 10 * 10 + 10) width
,	convert(varchar(50), (rowno-1) / 5 * 5 + 1) + ' ~ ' + convert(varchar(50), (rowno-1) / 5 * 5 + 5) width
,	rowno
from samples
option (maxrecursion 0)