Database Admins, help me with an sql statement please

Most of us are not "computer people" so post your technical questions and comments here. If you have computer or Internet expertise, share it here.

Moderators: carlson1, Keith B

Post Reply
User avatar

boomerang
Senior Member
Posts in topic: 1
Posts: 2629
Joined: Thu Sep 13, 2007 11:06 pm
Contact:

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

#1

Post 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.
"Ees gun! Ees not safe!"

atxgun
Senior Member
Posts in topic: 1
Posts: 923
Joined: Tue Oct 23, 2007 3:12 am
Location: Austin, TX
Contact:

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

#2

Post 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.
User avatar

LedJedi
Senior Member
Posts in topic: 1
Posts: 1006
Joined: Tue Jun 26, 2007 11:29 am
Location: Pearland, TX
Contact:

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

#3

Post by LedJedi »

SELECT * FROM users WHERE clue > 0
----------------------
0 Records returned
sorry, that's the only sql i know :)

Stupid
Senior Member
Posts in topic: 1
Posts: 910
Joined: Fri Nov 11, 2005 12:02 am

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

#4

Post by Stupid »

you need to add an "order_by"
Please help the wounded store owner who fought off 3 robbers. He doesn't have medical insurance.
http://www.giveforward.com/ramoncastillo" onclick="window.open(this.href);return false;
http://www.click2houston.com/news/26249961/detail.html" onclick="window.open(this.href);return false;
Post Reply

Return to “Technical Tips, Questions & Discussions (Computers & Internet)”