Search found 1 match

by atxgun
Tue Dec 23, 2008 8:58 pm
Forum: Technical Tips, Questions & Discussions (Computers & Internet)
Topic: Database Admins, help me with an sql statement please
Replies: 5
Views: 899

Re: Database Admins, help me with an sql statement please

if you're using mysql you want to use group_concat

Code: Select all

SELECT work_tickets.ticket_id, group_concat(work_tickets_assignment.assigned_to)
FROM            work_tickets JOIN
                         work_tickets_assignment using(ticket_id)
GROUP BY work_tickets.ticket_id
If not mysql i'm sure your flavor has some equivalent.

Edit: While I believe this describes what you want it may not be the best choice depending on what you're trying to do. If you just want to view the results from the sql prompt that's probably fine. But if you're returning the results to your application it may be better to just wrap them up in there.

Return to “Database Admins, help me with an sql statement please”