DPool34
DPool34

Reputation: 85

I need to remove rows from a query based on two conditions

I have a query that I need the results to be suppressed/removed under two conditions.

     SELECT
      CompanyID, 
      CustomerID, 
      Type,
      CustomerCode, 
      CustomerType, 
      CaseRank
     FROM Table
     ORDER BY CaseRank

I need to remove any rows that have a Type of "TypeA" AND a CaseRank that's not equal to 1.

Upvotes: 0

Views: 50

Answers (1)

Josh Part
Josh Part

Reputation: 2164

 SELECT
  CompanyID, 
  CustomerID, 
  Type,
  CustomerCode, 
  CustomerType, 
  CaseRank
 FROM Table
 WHERE NOT (Type='TypeA' AND CaseRank != 1)
 ORDER BY CaseRank

Upvotes: 2

Related Questions