cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Sql execute

munish
New Contributor

How a if else condition can be executed/written in a SQL execute snap? Like
if(condition)
do 1
else
do 2

1 REPLY 1

dimche_saveski
New Contributor III

Hello @munish
If else condition can be written in SQL execute snap with CASE statement. Example bellow:

Select EmployeeName,Salary
CASE
WHEN Salary > 70000 AND Salary < 100000 THEN โ€˜Seniorโ€™
WHEN Salary < 70000 THEN โ€˜Juniorโ€™
ELSE โ€˜Executiveโ€™
END as Position
from EmployeesTable