我用in语句怎么就不管用呢?

sheng9hhd 2003-08-21 11:42:33
select newsid,newstopic from newstable where '55' In (news_type)
数据库newstable表中的news_type有40,55却不显示!
news_type是nvarchar类型
求教如何解决???急!!!
...全文
95 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
sheng9hhd 2003-08-21
  • 打赏
  • 举报
回复
解决~惭愧惭愧啊~谢谢各位!!!
CrazyFor 2003-08-21
  • 打赏
  • 举报
回复
OR:
select newsid,newstopic from newstable where ','+news_type+',' like '%,55,%'
aierong 2003-08-21
  • 打赏
  • 举报
回复
select newsid,newstopic from newstable where news_type In ('55')
8992026 2003-08-21
  • 打赏
  • 举报
回复
select newsid,newstopic from newstable where news_type like '%55%'

lifeforu 2003-08-21
  • 打赏
  • 举报
回复
select newsid,newstopic from newstable where news_type In ('55')
不过说实话没有弄懂你的意思
CrazyFor 2003-08-21
  • 打赏
  • 举报
回复
select newsid,newstopic from newstable where charindex(','+'55'+',' , ','+news_type+',')>0


pengdali 2003-08-21
  • 打赏
  • 举报
回复
或:
select newsid,newstopic from newstable where charindex(',55,',','+news_type+',')>0

加,号是为了区分5和55
pengdali 2003-08-21
  • 打赏
  • 举报
回复
select newsid,newstopic from newstable where ','+news_type+',' like '%,55,%'
sheng9hhd 2003-08-21
  • 打赏
  • 举报
回复
up~

34,576

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧