Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
olly
Starting Member
5 Posts |
Posted - 2014-01-27 : 12:02:45
|
Hi, We're tyring to find the best way to solve the following, hope you can help please.We have a fairly large table of users (2500+) and the users belong to 1 or more groups (at the moment the max number of groups a user is in is 32 but it changes daily).A sample data set looks like:Usr | Grp==============SmithA | GrpASmithA | GrpBMouseM | GrpDMouseM | GrpBMouseM | GrpCThe result set we need would be:SmithA | GrpASmithA | GrpBSmithA | GrpA,GrpBMouseM | GrpBMouseM | GrpCMouseM | GrpDMouseM | GrpB,GrpCMouseM | GrpB,GrpDMouseM | GrpC,GrpDMouseM | GrpB,GrpC,GrpDNote the alphabetical order of the grps - it's not particularly imporant but if they aren't sorted alphabetical then we'd need all combinations.Any ideas please? |
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
|
|
|
|