我想写一条 删除的sql语句, Delete from tablename where (IP+':'+Port) in('10.1.2.0:8080','10.1.2.0:8080','10.1.2.0:8080')
如何将(IP+':'+Port)组合成一个 字符串然后在 in去中做条件查询呢?
4 个解决方案
#1
汗,原来用 cast可以搞定。
DELETE from VS_PMS WHERE (cast(VS_IP AS VARCHAR(30))+':'+
cast(VS_Port AS VARCHAR(30))) in ('10.12.13.4:1100')
DELETE from VS_PMS WHERE (cast(VS_IP AS VARCHAR(30))+':'+
cast(VS_Port AS VARCHAR(30))) in ('10.12.13.4:1100')
#2
你已经解决了哈?
#3
Delete from tablename where (IP+':'+Port) in('10.1.2.0:8080','10.1.2.0:8080','10.1.2.0:8080')
这样也可以啊
这样也可以啊
#4
因为我的 Port是 int类型,所以这么写的时候报错了
#1
汗,原来用 cast可以搞定。
DELETE from VS_PMS WHERE (cast(VS_IP AS VARCHAR(30))+':'+
cast(VS_Port AS VARCHAR(30))) in ('10.12.13.4:1100')
DELETE from VS_PMS WHERE (cast(VS_IP AS VARCHAR(30))+':'+
cast(VS_Port AS VARCHAR(30))) in ('10.12.13.4:1100')
#2
你已经解决了哈?
#3
Delete from tablename where (IP+':'+Port) in('10.1.2.0:8080','10.1.2.0:8080','10.1.2.0:8080')
这样也可以啊
这样也可以啊
#4
因为我的 Port是 int类型,所以这么写的时候报错了