Click here to Skip to main content
15,892,575 members

how to count the row number for the having a combination of same numbers

Revision 1
hi,

how to count the row number for the below table which is having a combination of same numbers when we are giving multiple values as input
@Member_ID = 39,51,---




ID Member_ID
18 39,39,39,51,39
25 51
97 41
102 41,51
113 41,116
155 39,217
888 41,49,147,149,151,148,175,68
662 202,202
841 116,3,3

the above combination is generated by writing the following query

select ID, substring(Applicant_Member_Ids,1,len(Applicant_Member_Ids)-1) from
(
select ID ,
(select convert(varchar, Applicant_Member_Id) + ',' as [text()] from Savings_Account_Applicant where ID =saa.ID for xml path('')) as Applicant_Member_Ids
from Savings_Account_Applicant saa
group by ID
) as Savings_Account;
Posted 8-Nov-12 1:55am by sk. maqdoom ali.
Tags: