Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

What should I do in an sql case when multiple conditions?

Asked by Benjamin Moore Sep 27, 2022 1.4K views 1 answer
Share

About this question

 I need to change returned value, from select statement, based on several conditions. I tried something like that:

,CASE i.DocValue  WHEN 'F2' AND c.CondCode IN ('ZPR0','ZT10','Z305') THEN c.CondVal

  ELSE 0

END as Value why it is not working and what is recommended way to do this ? There will be next several WHEN conditions.


Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.