sql - 如何在 SQL 中针对列表进行许多 OR 匹配?
问题描述
如何解决第一个逗号?存在语法错误。
if (@BAAgtNo = '0000ZV') and
(@ProfileNumber = '902876'***,*** '903673', '903674', '903675', '903676', '903677', '903678', '903679') -- If the booking agent result is 0 then..
begin
解决方案
我想你想要IN
:
if @BAAgtNo = '0000ZV' and
@ProfileNumber in ('902876', '903673', '903674', '903675', '903676', '903677', '903678', '903679') -- If the booking agent result is 0 then..
begin
推荐阅读
- azure - Start-AzVM:运行 Azure Runbook 时无法绑定参数“DefaultProfile”
- python - 在 Python 上创建两个单独的图
- c - 从非主文件中获取 argv[0],例如 _start no libc ,no libs
- javascript - 如果内部数组的元素超过 X,则获取多维数组中的元素
- node.js - 从数组中删除对象 id 在猫鼬中不起作用
- python-3.x - 检查列表元素是否是从列表中添加其他元素的结果
- python - 大家好你们好。我正在用 django 开店,但自定义用户有问题
- vue.js - 按钮单击nativescript vue后的空文本字段
- python - Pandas 动态添加列和索引并更新现有列
- sql - 在 PostgreSQL 表中排序,保留前行的值