日期:2014-05-18  浏览次数:20529 次

怎么不搜索HTML标签内容

我有个表,里面有一个字段包含HTML格式内容的数据

现在想在搜索的时候输入关键字模糊查询的时候如:HTML,TABLE.TD,TR等HTML标签,不把这些内容搜索出来,能不能解决.

什么方法都可以,我做了全文索引



------解决方案--------------------
/*------------------------
select * from
(
select ' <html> 132 </html> ' as colHTML union all
select ' <html> 132html </html> 'as colHTML union all
select ' <html asf /> 'as colHTML
) tb
where colHTML like '%[^ <^/]HTML% '
------------------------*/
colHTML
--------------------
<html> 132html </html>

(1 row(s) affected)
------解决方案--------------------
有点棘手,顶
------解决方案--------------------
楼主应该是要搜索内容或标题,不是搜索TAG。
------解决方案--------------------
declare @Keyword varchar(32),@sql varchar(1000)
set @Keyword= 'HTML '
set @sql= 'select * from tb where colHTML like %[^ <^/] ' + @Keyword + '% '
exec(@sql)