I have a function like this:
This follows the syntax
if(condition,true,false). I was looking for a way to convert this into an SQL query like so:
select case when a>b then case when b>c then a else b end else c end
I thought of splitting the input and passing it on my own, but I was hoping there was a better way to do this.
Any help is appreciated!
Thanks in advance.
You can use IIF function as well… Please check the link for description.
So for you it would be something like SELECT IIF (a > b, IIF ( B > C, A, B ), C ) AS Result;
Sytax is not tested but would work.