469,267 Members | 1,101 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

Group_concat Question

I am attempting to pull data from multiple tables into a resultset that
I can use as an Excel spreadsheet for reporting. Here is my query so
far:

SELECT b.bug_id,p.realname as 'Assigned'
,bug_status,b.resolution,b.short_desc,l.thetext
as 'Description/Comments',b.creation_ts as 'Opened',b.delta_ts as 'Last
Update'
FROM bugs b, longdescs l, profiles p
WHERE b.bug_id=l.bug_id and b.assigned_to=p.userid and b.bug_status in
('new','assigned')
group by b.bug_id
order by bug_status,Opened

This produces what I need, except that for the field 'thetext' there is
a many to one relationship back to bug_id. I'm trying to use the
GROUP_CONCAT command, but when I add it:

SELECT b.bug_id,p.realname as 'Assigned'
,bug_status,b.resolution,b.short_desc,
Group_Concat (l.thetext) as 'Description/Comments',b.creation_ts as
'Opened',b.delta_ts as 'Last Update'
FROM bugs b, longdescs l, profiles p
WHERE b.bug_id=l.bug_id and b.assigned_to=p.userid and b.bug_status in
('new','assigned')
group by b.bug_id
order by bug_status,Opened

I get an error 1064 saying that the syntax is wrong near (l.thetext) on
line 2. I've tried quite a few variations with the parenthesis and
order but nothing seems to help.

Any suggestions or hints would be greatly appreciated! :-)

Thanks,
Gordon

Jan 26 '07 #1
0 3203

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by peter stickney | last post: by
3 posts views Thread by Stevey | last post: by
bilibytes
1 post views Thread by bilibytes | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.