If in Where Clause for SQL Query

What is the correct syntax for using an IF in a WHERE clause? I need something like


Where IF (A, B='PO', C='OS')

In this example "A" is a logical
B is an Order Type
C is a Status)
sfletcher1959VPAsked:
Who is Participating?
 
jamesguConnect With a Mentor Commented:
what do you exactly by Where IF (A, B='PO', C='OS')? something like if A is true ues the condition b='PO', otherwise use c='OS'.

If this is what you wanted, use this

where ( condition_a  and B='PO') or (not condition_a  and C='OS')

please give more information
0
 
sfletcher1959VPAuthor Commented:
Thanks!
0
All Courses

From novice to tech pro — start learning today.