Josh Benoit
Josh Benoit

Reputation: 3

How to filter when two columns both equal a value

For example:

SELECT 
t.a
,t.b
,t.c

FROM table t
WHERE (t.a and t.c) = 'value'

If i just do two lines in the where clause its not quite right, i only need to select when they are BOTH the same and not when its one or the other

Upvotes: 0

Views: 64

Answers (1)

Matt Cremeens
Matt Cremeens

Reputation: 5151

Just change this

WHERE (t.a and t.c) = 'value'

to this

WHERE t.a='value' and t.c='value'

Upvotes: 1

Related Questions