34,590
社区成员
发帖
与我相关
我的任务
分享
SELECT * FROM NewsSort
WHERE charindex(',1,2,3,', ','+Tree+',')=1 and charindex(',',Tree,4)=0
select isnumeric('1.1')
select isnumeric('1/1')
select isnumeric('1,1')
/*
-----------
1
(所影响的行数为 1 行)
-----------
0
(所影响的行数为 1 行)
-----------
1
(所影响的行数为 1 行)
*/
SELECT * FROM NewsSort WHERE PATINDEX('[^0-9]',REPLACE(Tree ,'1,2,3,',''))=0 AND Tree LIKE '%1,2,3,%'
where tree like '1,2,3,%' and isnumeric(right(tree,len(tree)-6))=1