标签:
如,要在数据库中包含这样数据的记录有多少条:
<table class="link-more-blue" style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr class="grid-head-wrap">
<td>File Name</td>
<td width="110">Size</td>
<td width="70"> </td>
</tr>
</tbody>
</table>
直接使用 SQL语句查询:
SELECT count(*) FROM driver_lookup_com.content
where introtext like ‘%<table class="link-more-blue" style="width: 100%;" border="0" cellspacing="0" cellpadding="0"><tbody>"+
"<tr class="grid-head-wrap"><td>File Name</td><td width="110">Size</td><td width="70"> </td></tr></tbody></table>%‘;
结果没数据返回,明明数据库中就有记录,为什么呢,可能是忘了换行符?
SELECT count(*) FROM driver_lookup_com.content
where introtext like ‘%<table class="link-more-blue" style="width: 100%;" border="0" cellspacing="0" cellpadding="0">\r\n<tbody>"+
"\r\n<tr class="grid-head-wrap">\r\n<td>File Name</td>\r\n<td width="110">Size</td>\r\n<td width="70"> </td>\r\n</tr>\r\n</tbody></table>%‘;
换行符:Windows用 \r\n
Linux用 \n
标签:
原文地址:http://www.cnblogs.com/tommy-huang/p/4545612.html