社区
MS-SQL Server
帖子详情
请教in的用法?
blueroute
2005-07-26 12:28:17
字段type是个字符串,如'2,3,4,5'
我用
select * from tablename where '2' in (type)
每次只能查处type只为'2'的记录,不能包含'2,3,4'的记录
请教!
...全文
88
7
打赏
收藏
请教in的用法?
字段type是个字符串,如'2,3,4,5' 我用 select * from tablename where '2' in (type) 每次只能查处type只为'2'的记录,不能包含'2,3,4'的记录 请教!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
joyco
2005-07-26
打赏
举报
回复
select * from tb1 where charindex(type,'2')=1
xueguang
2005-07-26
打赏
举报
回复
没必要用in,可以以下方法:
select * from tablename where type like '%2%'
select * from tablename where charindex('2',type)>0
子陌红尘
2005-07-26
打赏
举报
回复
select * from tablename where charindex(',2,',','+type+',')>0
vivianfdlpw
2005-07-26
打赏
举报
回复
select * from tablename where charindex(',2,',','+type+',')>0
liuzijing688
2005-07-26
打赏
举报
回复
select * from tablename where type like '%2%'
select * from tablename where charindex('2',type)>0
peanutsun
2005-07-26
打赏
举报
回复
select * from tablename where type in ('2','3','4','5')
GRLD8888
2005-07-26
打赏
举报
回复
select * from tb1 where charindex(name1,'2')=1
在pandas中一次性删除dataframe的多个列方法
之前沉迷于使用index删除,然而发现pandas貌似有bug? import pandas as pd import numpy as np df = pd.DataFrame(np.arange(12).reshape(3,4), columns=['A', 'B', 'C', 'D']) x=[1,2] df.drop(index=[1,2], ...
webservice报错Message part refundRequest was not recognized. (Does it exist in service WSDL?)
因为接口方使用webservice交互. 我只能去学习了下webservice 现在出了一个很古怪的问题~ 我在请求他们url的时候, 返回给我找不到控制名错误 Message part refundRequest was not recognized. (Does ...
20周年特别活动:从码农到财富自由,8大博客专家在线指导
与大牛老师互动+
请教
,请扫码入群
mysql in报错_MySQL WHERE IN()?mysql
关于MySQL WHERE IN()?mysql的搜索结果问题mysql分页的sql语句,求解???String sql = "select s.* from user s where s.id limit ((?-1)*?),?";You have an error in your SQL syntax; ...爱吃鱼的程序员2020-08-...
SQL IN 子查询返回多个值
下午遇到一个问题,IN子查询返回多个值。网上查了很多文档,资料,都没收获。问了技术群的同僚,竟然还被嘲笑了。IN 怎么可能匹配多个字段呢!个人印象中曾经在哪里见到过,所以就觉得不服气。自己慢慢地去试,试...
MS-SQL Server
34,593
社区成员
254,589
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章