I have 3 tables and I'm trying to create a report...
Table MP (data table)
mID col1 col2
1 data1 data2
2 data3 data4
3 data5 data6
Table MPU (user table)
uID UserName
1 user1
2 user2
3 user3
Table MPR (lookup table)
rID uID mID
1 1 2
2 2 2
3 1 1
This is the basic select logic I need:
Select
MP.mID
,MP.col1
,MP.col2
,MPU.UserName --format as 'user1, user2, user3' ...
From MP
left join MPR on MPR.mID = MP.mID
left join MPU on MPU.uID = MPR.uID
I need to add the username strings together as commented in code.
Some data rows will have no users and others could have as many as 10.
I don't want multiple rows being populated as it is now.
EDIT:
Note - SQL 2000