关于SQL语句,字段含有数组进行比较的问题! id a1 2|32 1|23 12|1如何查询A字段中包含2的记录。而12这样不算。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tbwhere charindex('|2|','|'+a+'|')>0 declare @val varchar(10)set @val='2'select * from tb where charindex('|'+@val+'|','|'+a+'|')>0 --或者:select * from tb where '|'+a+'|' like '%|2|%' 忘记说了。数据库是ACCESS的。请问有什么方法吗? id a 1 2 ¦3 2 1 ¦2 3 12 ¦1 如何查询A字段中包含2的记录。而12这样不算。-------------------------sql serverselect * from tb where charindex(',2,' , ',' + a + ',') > 0 access 应该是用SEARCH(find_text,within_text,start_num)吧 ,好像是select * from tb where SEARCH( '|' + a + '|','|2|',1) > 0 sql2005登入问题 SQL 在一表中插入一行的问题。 我想动态更新字段名却不行 我接手别人的程序,维护中遇到个问题,请大家指教,是插入纪录报错!~~~急!~~~ 请问邹建大哥:有关SQL的跟踪器的配置问题. MS SQL 2005 X64 使用超过4G内存还需要启用AWE吗? 如何知道一个备份设备是否存在? 设计数据库的问题 一个select语句的写法 请大家讨论一下,如果SQL语句查询时间需要很长,如何建立一个进度项来显示 用企业管理器建立数据时出错错误. ASP+SQL多条件查询判断是否为空的代码
from tb
where charindex('|2|','|'+a+'|')>0
declare @val varchar(10)
set @val='2'
select * from tb where charindex('|'+@val+'|','|'+a+'|')>0
--或者:select * from tb where '|'+a+'|' like '%|2|%'
1 2 ¦3
2 1 ¦2
3 12 ¦1
如何查询A字段中包含2的记录。而12这样不算。-------------------------sql serverselect * from tb where charindex(',2,' , ',' + a + ',') > 0
SEARCH(find_text,within_text,start_num)吧 ,
好像是
select *
from tb
where SEARCH( '|' + a + '|','|2|',1) > 0