读取单元格值和检查SQL [英] Reading Cell Value and Checking in SQL

查看:63
本文介绍了读取单元格值和检查SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢选择值,例如



i simlpy select value like

SELECT '345/576' as Test





现在我要查看



如果'345/576'包含'/'然后错误否则无错误。



now i want to check that

if '345/576' contain '/' then error else No Error.

推荐答案

您可以使用 SQL LIKE运算符 [ ^ ] in接受(或拒绝)特定的列格式。
You may use the SQL LIKE operator[^] in order to accept (or reject) a particular column format.


检查一下:

Check this one :
select case when charindex('/', '345/576')>0 then '345/576' else 'error' end



'345/576'替换为字段名称并添加来自语句和其他内容...



希望它清楚。


Replace '345/576' with a field name and add from statement and other things...

Hope its clear.


这篇关于读取单元格值和检查SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆