MycrowSoft
MycrowSoft

Reputation: 173

Select combinations of two columns in a where clause

I have a table that looks like this

enter image description here

In this table I have to filter my select query with a where clause with four particular combinations of tp1 and tp2. I want to select data based on (tp1= A and tp2 = A) and (tp1=B and tp2 = C). I think I might have to use case statements in the where clause but I am not sure how to do that.

Upvotes: 1

Views: 2218

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269493

Does this do what you want?

WHERE (tp1 = 'A' and tp2 = 'A') OR (tp1 = 'B' and tp2 = 'C')

Upvotes: 2

Related Questions