I want execute certain set of SQL statements based on parameters passed on from json and they all should be in single SQL.
I have 3 conditions namely
1. Give 2. Take 3. Both
Now in Netezza SQL,
I would like to have something as below:
if %input = 'Give'
set of give sql statements
else if %input = 'Take'
set of take sql statements
else
set of both sql statements.
After searching I found below links,but not sure if this is possible in Netezza.
Can you have if-then-else logic in SQL?
How do I perform an IF...THEN in an SQL SELECT?
Can anyone please guide me?
I am new to Netezza db
Thanks Maddy