我想选择所有行,数字和逗号,没有别的.例如,这些varchars应该由select返回:
1
1,2
1,2,3
Run Code Online (Sandbox Code Playgroud)
你知道怎么做吗?
如果我理解正确:
where col not like '%[^,0-9]%'
Run Code Online (Sandbox Code Playgroud)
如果要阻止两个逗号连续:
where col not like '%[^,0-9]%' and
col not like '%,,%'
Run Code Online (Sandbox Code Playgroud)
我觉得有必要在逗号分隔的列表中添加存储数字是一个非常糟糕的主意.
| 归档时间: |
|
| 查看次数: |
62 次 |
| 最近记录: |