谁会想到(Image类型)的这个问题?

xboypunk2004 2006-12-05 06:15:12
某表A有一Image类型列ima,现已知该列中包含数据 0XBBBFBFBF........
有什么办法可以查出该列包含 %BBBFB%
就像select * from A where ima like %BBBFB%
当然我这个办法是不行的。所以求助大师门。
...全文
178 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
study_boy 2006-12-11
  • 打赏
  • 举报
回复
发错地方了,不好意思^^!!!
study_boy 2006-12-11
  • 打赏
  • 举报
回复
如果你语句没错的话,试试这样写,我前天也遇到过和你相似的情况

'select * from (select top '+ Cast(@num1 as nvarchar(100)) + ' percent * from test where testCourse=''ccjxtjc'' order by newid())a union all
select * from (select top '+ Cast(@num2 as nvarchar(100)) + ' percent * from test where testCourse=''dyjxl'' order by newid())b union all
select * from (select top '+ Cast(@num3 as nvarchar(100)) + ' percent * from test where testCourse=''qtks'' order by newid())c union all
select * from (select top '+ Cast(@num4 as nvarchar(100)) + ' percent * from test where testCourse=''rjbf'' order by newid())d union all
select * from (select top '+ Cast(@num5 as nvarchar(100)) + ' percent * from test where testCourse=''smyxl'' order by newid())e union all
select * from (select top '+ Cast(@num6 as nvarchar(100)) + ' percent * from test where testCourse=''yjwxjs'' order by newid())f)h'
xboypunk2004 2006-12-11
  • 打赏
  • 举报
回复
不行啊
Tigersong 2006-12-06
  • 打赏
  • 举报
回复
select * from A where SUBSTRING(ima,1,8000) like '%BBBFB%'
Tigersong 2006-12-06
  • 打赏
  • 举报
回复
select * from A where PATINDEX('%BBBFB%',ima)>0
xboypunk2004 2006-12-06
  • 打赏
  • 举报
回复
不对啊。查不出来。。。我的是SQLSERVER2005
gc_ding 2006-12-05
  • 打赏
  • 举报
回复
select * from A where cast(ima as varbinary) like '%BBBFB%'
oooooo126 2006-12-05
  • 打赏
  • 举报
回复
错了,顶
oooooo126 2006-12-05
  • 打赏
  • 举报
回复

select * from 表 where convert(varchar(max),image字段) like '%BBBFB%'

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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