SQL Server Performance

SQL Script

Discussion in 'General DBA Questions' started by fauzanf, Dec 14, 2009.

  1. fauzanf New Member

    Hello My Friends,

    I'm a new member in TechRepublic.
    I have a question, about SQL Script. I'm Using SQL Server 2008.

    I have one table, contain 3 Fields... It's ID,STATUS,JUDGE

    1. ID -- AutoNumber
    2. STATUS -- Only 3 Words... PASSED, HOLD, REJECTED
    3. JUDGE -- BOOLEAN (TRUE/FALSE)

    I want to know the SQL Script, if i have two criteria to filter.

    1. Show All records that STATUS IS NOT PASSED
    2. Show All records that STATUS IS PASSED AND JUDGE IS TRUE.

    SQL Script for No. 1:
    SELECT * FROM TableName WHERE Status<>'PASSED'

    SQL Script for No. 2:
    SELECT * FROM TableName WHERE Status='PASSED' AND Judge=TRUE

    How to combine the two scripts above into one script...???

    Need help and advice.
    Regards,
    Fauzan
  2. GeriReshef New Member

    SELECT * FROM TableName WHERE Status<>'PASSED' Or Judge=TRUE
  3. fauzanf New Member

    Oh please... Damn, It's so simple, [:p]
    Anyway, thanks very much... [<:eek:)]

Share This Page