How would I write a query that involves the following check:
if colA is null then colB = colB1 + colB2
if colA is not null then colB = colA
|
How would I write a query that involves the following check: if if |
||||
|
|
|
According to SQL Standards (works with multiple flavors of SQL), you can use the
or a
Using T-SQL (works with Sybase and Microsoft SQL Server)
However, you've not told us about any guarantees that either
or using
If you don't want to use it in the result but in a
or:
but you have one more option:
|
||||
|
|