Case When Then Kullanımı

Kullanımı

Case When Then Kullanımı. Where 1 case when at userrole analyst then case when supervisorapprovedby is null then 1 end when. Case a when ok then c ok when bad then c bad an expression is something that can be evaluated on the right hand side of an assignment or in a select statement for instance.

Sql Case Ifadesi Ve Kullanimi Ders 27
Sql Case Ifadesi Ve Kullanimi Ders 27

So it returns 2. The case statement can be used in oracleplsql. The noticeable absence of a column name as part of the case expression permits any number of columns to be specified from the underlying tables in the when thenelse logic scenarios.

When at userrole analyst the comparison supervisorapprovedby null will give unknown and the row wont pass the where test.

Where 1 case when at userrole analyst then case when supervisorapprovedby is null then 1 end when. You could use the case statement in a sql statement as follows. So it returns 2. You can rewrite with nested case expressions.