select * from QunList361_370 where Class='369'and Title like 'ttt' union all   select * from QunList361_370 where Class='369'and QunText like 'ttt'这句如何缩减

解决方案 »

  1.   


    select * from QunList361_370
    where Class='369'and (Title like 'ttt' or QunText like 'ttt')这样也可以..
      

  2.   


    select * from QunList361_370 
    where Class='369'and (Title like 'ttt' or QunText like 'ttt')
      

  3.   

    就是变成一个 SELECT 而不是两个SELECT
      

  4.   

    SELECT  *
    FROM    QunList361_370
    WHERE   Class = '369'
            AND (Title LIKE '%ttt%'
            or QunText LIKE '%ttt%')
      

  5.   

    SELECT  *
    FROM    QunList361_370
    WHERE   Class = '369'
            AND (Title LIKE '%ttt%'
            or QunText LIKE '%ttt%')
      

  6.   

    完全等价并简化的语句如下:
    select * from QunList361_370 where Class='369'and (Title='ttt' or QunText='ttt')
      

  7.   

    Select * From QunList361_370 
    Where Class = '369' and (Title like 'ttt' or QunText like 'ttt')