I have a basic SQL query, starting with:
SELECT top 20 application_id, [name], location_id FROM apps
Now, I would like to finish it so that it
You don't really need the ternary operator for this:
SELECT top 20 application_id, [name], location_id FROM apps WHERE (@lid > 0 AND location_id IN (@lid)) OR @lid <= 0