Skip to content
Advertisement

SQL Execute one query of 2 based on condition

I have 2 working query that I need to use to generate a report, I have configured 4 parameters that user can choose and I want that if idarea=0 then first query is executed, else second one. I tried the following but give me an error because of the nested with… any help? Thanks

Advertisement

Answer

Just use IF:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement