表 messageid       title                content1        您有新短消息         <MEMO>
2        您有新短消息         <MEMO>
3        您有新短消息         <MEMO>
4        您有新短消息         <MEMO>
5        您有新短消息         <MEMO>
6        您有新短消息         <MEMO>
7        您有新短消息         <MEMO>content 的 <MEMO> 
<img src="http://localhost:8080/fybbs/pic/newmail.gif"><a href="http://localhost:8080/fybbs/bbs_messageRead.do?msgID=34&action=inbox " target="_top">您有新短消息<img src="http://localhost:8080/fybbs/pic/newmail.gif"><a href="http://localhost:8080/fybbs/bbs_messageRead.do?msgID=123&action=inbox " target="_top">您有新短消息<img src="http://localhost:8080/fybbs/pic/newmail.gif"><a href="http://localhost:8080/fybbs/bbs_messageRead.do?msgID=254&action=inbox " target="_top">您有新短消息<img src="http://localhost:8080/fybbs/pic/newmail.gif"><a href="http://localhost:8080/fybbs/bbs_messageRead.do?msgID=13&action=inbox " target="_top">您有新短消息<img src="http://localhost:8080/fybbs/pic/newmail.gif"><a href="http://localhost:8080/fybbs/bbs_messageRead.do?msgID=11&action=inbox " target="_top">您有新短消息<img src="http://localhost:8080/fybbs/pic/newmail.gif"><a href="http://localhost:8080/fybbs/bbs_messageRead.do?msgID=17&action=inbox " target="_top">您有新短消息<img src="http://localhost:8080/fybbs/pic/newmail.gif"><a href="http://localhost:8080/fybbs/bbs_messageRead.do?msgID=56&action=inbox " target="_top">您有新短消息怎么样 能 查出 msgID=56 的这条记录  (只有content 的数据有msgID)

解决方案 »

  1.   

    select * from message where content like '%msgID=56&%'
      

  2.   

    --仿佛&符号只有一个
    select *  from tb where chaindex('&',content)>0
      

  3.   

    select * from message where charindex('msgID=56&',content)>0
      

  4.   

    select * from message where content PARSEINDEX('%msgID=56%',CONTENT)>0
      

  5.   

    ...弄错 
    select * from message where content  patindex('%msgID=56&%',content)>0
      

  6.   

    select * from message where content PATINDEX('%msgID=56%',CONTENT)>0
    晕,也打错了,呵呵
      

  7.   

    是mysql  这些函数不能用啊
      

  8.   

    select * from message where content like '%msgID=56&%'
      

  9.   

    select * from message where instr(content,'msgID=56')>0
      

  10.   

    或select * from message where instr(content,'msgID=56&')>0
      

  11.   

    select * from message where find_in_set('msgID=56',content)>0