3

I would like to take the data output from the query below and join all of the email addresses together separated by a semicolon grouped by the employee name.

SELECT
    DISTINCT
    p.email
    , e.name 
FROM
    PERSON p
INNER JOIN 
    EMPLOYEE e
ON 
    p.agentofrecord_id = e.employee_id 
WHERE 
    dbo.GetPersonMember(p.person_id) = 1
    AND (p.isactive = 1)
    AND p.email <> ''
ORDER BY name
3

1 Answer 1

5

Basically, it looks like you want MySql's GROUP_CONCAT aggregate function in TSQL. If that's the case, this article may help -- check it out!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.