General discussion
-
Topic
-
difficult SQL query
LockedI want to do a query on 3 tables. In the example below if there is more then 1 record in Table2 linked to T1 then multiple rows are returned for each table 1.
SELECT T1.MT_ID, T2.FULL_NAME
FROM Table1 T1
LEFT JOIN Table2 T2ON T1.MT_ID = T2.MP_MT_ID AND T2.ISActive = ‘T’
i.e.
1 Joe Dunkin
1 John Milken
1 Robert Johnson
2 Null
3 Jen BergerI would like to use a query that returns only one row fro each record in Table1 and concatenates the Full Names if more then on exists.
i.e.
1 Joe Dunkin, John Milken, Robert Johnson
2 Null
3 Jen BergerEtc.