![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
declare
@t
table
(value
varchar
(
10
))
insert @t
select ' F000001 '
union all
select ' F000002 '
union all
select ' F000003 '
u
nion
all
select ' F000004 '
union all
select ' F000006 '
union all
select ' F000007 '
union all
select ' F000008 '
union all
select ' F000009 '
union all
select ' F000010 '
select min (value) + ' - ' + max (value)
from @t
group by right (value, 6 ) / 5
insert @t
select ' F000001 '
union all
select ' F000002 '
union all
select ' F000003 '
u
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
select ' F000004 '
union all
select ' F000006 '
union all
select ' F000007 '
union all
select ' F000008 '
union all
select ' F000009 '
union all
select ' F000010 '
select min (value) + ' - ' + max (value)
from @t
group by right (value, 6 ) / 5
有时候很复杂的东西能够做出来,反而比较简单的却想不出来解决办法。
这个是网上看到的,感觉很有意思。至少能够在自己绞尽脑汁的时候想想是不
是还有其他简单的解决办法。