Tuesday, February 14, 2012

Custom aggregate function

hi how do i write a custom aggregate function or select query.I have Table name MemberDetail where which has two column Memberid and WokingDay.In this table same member could have multiple working days. i want select query that will return single row for each member and his/her quama separated working days. without using cursor. how do i do that.

eg

Table MemberDetail

MemberID WorkingDay

M1234 12

M1234 10

M1555 02

M1555 15

See

http://www.aspfaq.com/show.asp?id=2529

|||

cool its working,but i also wanted to get count as

MEMBERID WORKINDAYS COUNT

M1234 12,10 2

M1555 02,15 2

|||select MEMBERID, yourstrcatfunction(MEMBERID), count(*)
from yourtable
group by MEMBERID

No comments:

Post a Comment