Bug #58208 Single row result instead of resultset data
Submitted: 15 Nov 2010 18:39 Modified: 15 Nov 2010 18:52
Reporter: Amit Dutta Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.0 OS:Any
Assigned to: CPU Architecture:Any

[15 Nov 2010 18:39] Amit Dutta
Description:
I have two tables say:
orders
======
id (PK)
order_date

order_item
==========
id (PK)
order_id (FK)
description

My program runs a query as:
select distinct o.id as order_id, oi.id as order_item_id from orders o, order_item oi where o.id = oi.order_id and oi.order_id = 1;

I expect mysql to return:(I know this is standard, however is there no way to return the result set of the child table in single row rather multiple?)
order_id order_item_id
-------- -------------
1        1, 2

It is returning resultset: 
order_id order_item_id
-------- -------------
1        1
1        2

How to repeat:
Same steps as above.
[15 Nov 2010 18:42] Amit Dutta
Editing the typo on synopsis
[15 Nov 2010 18:52] Valeriy Kravchuk
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug. Check http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.