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 ()
精彩评论