select * from TABLe1 where content like '%AA%' or content like '%bb%'这样行不?

解决方案 »

  1.   

    select content from table1 where content like '%AA%' and content like '%bb%' 
      

  2.   

    在一个或多个表上执行上面的SQL语句,在界面上显示数据库执行结果.
      

  3.   

    select content from table1 where content like '%AA%' and content like '%bb%' 
      

  4.   

    楼主的需求没有说清楚。如果只是简单的搜索包含两个字符串,那用1楼的方法可以实现“或”,用4楼的方法可以实现“与”查询。如果楼主想实现复杂的站内搜索引擎,那你可以研究一下DNN(DotNetNuke)是如何实现的(我博客里有相关文章:http://blog.csdn.net/cheng_feng001/archive/2008/02/22/2112924.aspx)。
      

  5.   

    在SQL中给表TABLe1加上全文检索功能
    sql语句如果只在一个字段content上来查 可以用以下代码:select * from table1 where contains (content,'"AA and bb"')如果在所有的字段上来查 可以用:select * from table1 where freetext(*,'"AA and bb"')
     
      

  6.   

    百度之site:你的网址 + 关键字1 + 关键字2
    over