Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

Multiple In Statement

I have 2 fields ... Branch and Salesperson... Can i write an In Statement to resemble this??

Branch in ('11') and Salesperson ('123') then 'Field3'... I tried a Case When, then statement and I couldnt get it to work.. Any ideas?
1 Solution

I'm not sure I understand. Are you looking for this:

SELECT CASE WHEN Branch='11' AND Salesperson='123' THEN 'Field3' END
FROM yourtable

or if you really like IN

SELECT CASE WHEN Branch IN ('11') AND Salesperson IN ('123') THEN 'Field3' END
FROM yourtable

Otherwise perhaps you could give some more details.


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now