create table T(bmallid varchar(20), [text] varchar(20)) insert T select '52', '结点一' insert T select '52001', '结点二' insert T select '52002', '结点三'insert T select '53', '结点四'select * from T where bmallid like ( select top 1 bmallid+'%' from T where [text]='结点一' )--result bmallid text -------------------- -------------------- 52 结点一 52001 结点二 52002 结点三(3 row(s) affected)
insert T select '52', '结点一'
insert T select '52001', '结点二'
insert T select '52002', '结点三'insert T select '53', '结点四'select * from T
where bmallid like
(
select top 1 bmallid+'%' from T where [text]='结点一'
)--result
bmallid text
-------------------- --------------------
52 结点一
52001 结点二
52002 结点三(3 row(s) affected)