开发者

Finding particular value in multivalue parameter

I am making a report in ssrs.I am sending a multi value parameter(comma separted) called @partnerAlias in a report query. Depending on whether the p开发者_JAVA技巧arameter(@PartnerAlias) contains a particular value called 'none' or not, my query will change.How can i find whether a particular value is there in multivalue parameter using SQL so that i can put condition in query. I am new to SQL


Multi-valued parameters in Reporting Services work just like subqueries, so you can do this sort of thing:

SELECT ...
FROM ...
WHERE 'none' IN (@partnerAlias)

Likewise the IN (@partnerAlias) clause could be in an IF statement outside of the query:

IF 'none' IN (@partnerAlias)
    SELECT ...
ELSE
    SELECT ...


you can do it like this:

Select * 
from Table1 
join Table2 on(condition) 
left Join Table 3 on (condition) and (('none' in(@partnerAlias) and myStatement1) or  ('none' not in(@partnerAlias) and myStatement2))
group by ()
orderby ()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜