MySQL查询长数据是无值返回(可以尝试换行符)

  如,要在数据库中包含这样数据的记录有多少条:

  <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">&nbsp;</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">&nbsp;</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">&nbsp;</td>\r\n</tr>\r\n</tbody></table>%';

      

    换行符:Windows用 \r\n

               Linux用 \n

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值