472,131 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,131 software developers and data experts.

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 3263

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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.