I have a query like this,
with t as (
<your query here>
)
select t.id, t.name, t.randomid, trand.name as randomname
from t left join
t trand
on t.randomid = trand.id
where t.id in (select item from dbo.ufnSplit(@ids,','));
How can I add check so that if @ids
is null or empty only then use where
condition, I want this condition only if @ids is not null or empty ?
where t.id in (select item from dbo.ufnSplit(@ids,','));