473,803 Members | 3,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.real name as 'Assigned'
,bug_status,b.r esolution,b.sho rt_desc,l.thete xt
as 'Description/Comments',b.cre ation_ts as 'Opened',b.delt a_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','assigne d')
group by b.bug_id
order by bug_status,Open ed

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.real name as 'Assigned'
,bug_status,b.r esolution,b.sho rt_desc,
Group_Concat (l.thetext) as 'Description/Comments',b.cre ation_ts as
'Opened',b.delt a_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','assigne d')
group by b.bug_id
order by bug_status,Open ed

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 3325

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2715
by: peter stickney | last post by:
I am using the GROUP_CONCAT() as follows: SELECT (SELECT CONCAT(ProjectName) FROM Project WHERE FIND_IN_SET(ProjectID, RelatedProjectID))AS RelatedProject We have a project tracker system and we can have one project be related to several different projects. the issue is when there is only 1 related project associated with another project, this query does not work. Is there some sort of bug with GROUP_CONCAT?
3
5044
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
2667
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask it differently. FOUR QUESTIONS: The background: I got three (3) files
3
3096
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table before rowID answID qryrow questionID datafield 1591 12 06e 06e 06e question 1593 12 06f 06f 06f question 1594 12 answer to the question 06f
2
1709
by: phillip.s.powell | last post by:
Here are my results using MySQL 4.1.12 and I honestly don't think this is right, but can't figure out what to do: mysql> select id, group_concat(DISTINCT school_enrollment_time_name SEPARATOR ',') as school_enrollment_time_display from school_enrollment_time group by id; +----+--------------------------------+ | id | school_enrollment_time_display | +----+--------------------------------+ | 1 | spring |
2
1945
by: phillip.s.powell | last post by:
SELECT s.id, s.student_first_name, s.student_last_name, IF(s.student_ethnicity_interest_other IS NOT NULL AND s.student_ethnicity_interest_other != '', CONCAT(s.student_ethnicity_interest_other, ', ', e.ethnicity_name), GROUP_CONCAT(DISTINCT e.ethnicity_name ORDER BY upper(e.ethnicity_name)) ) AS ethnicity_name FROM student s, ethnicity e, student_ethnicity_interest_assoc seia
0
1228
by: phillip.s.powell | last post by:
$if1 = "IF(s.student_ethnicity_interest_other IS NOT NULL AND s.student_ethnicity_interest_other != '', " . " CONCAT(s.student_ethnicity_interest_other, ', ', GROUP_CONCAT(e.ethnicity_name ORDER BY upper(e.ethnicity_name))), " . ' GROUP_CONCAT(e.ethnicity_name ORDER BY upper(e.ethnicity_name))' . " ) AS ethnicity_name \n\n"; This segment of a larger SQL query produces a string that normally looks like these:
2
1811
rizwan6feb
by: rizwan6feb | last post by:
I have created a table (with only 2 fields) with the following query "CREATE TABLE `users` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `name` VARCHAR( 20 ) NOT NULL ) ENGINE = MYISAM ;" There are 20,000 users in this table with ids from 1 to 20,000
1
5753
bilibytes
by: bilibytes | last post by:
Hi, I'm wondering how to achieve the following: well i don't know if you guys like wine but I have to explain a very little on wine to explain my example: Wine is made from grape and a wine bottle may be made from different sorts of grape. So when you have a bottle it usually says: 10% of shyra, 50% of cabernet and 40% of merlot meaning that the wine in the bottle was made from that percent of each grape type. that was it for wine. ...
0
9566
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10300
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7607
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2974
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.