Page 1 of 1

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

Posted: Tue Dec 23, 2008 6:44 pm
by boomerang
I don't know if you can do that with a simple sql query. You may have to write a pl/sql function.

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

Posted: Tue Dec 23, 2008 8:58 pm
by atxgun
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.

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

Posted: Tue Dec 23, 2008 9:58 pm
by LedJedi
SELECT * FROM users WHERE clue > 0
----------------------
0 Records returned
sorry, that's the only sql i know :)

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

Posted: Tue Dec 30, 2008 10:31 pm
by Stupid
you need to add an "order_by"