If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > return transactions from supermarket

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-13-10, 21:33
djuritz djuritz is offline
Registered User
 
Join Date: Sep 2005
Posts: 67
return transactions from supermarket

Hi all,

I need to convert data from the following format:

TRANS_ID PRODUCT
1 A
1 B
1 C

to the following format:

TRANS_ID PRODCUTS
1 A,B,C

Is there any function to return data like this ?

Thanks
Reply With Quote
  #2 (permalink)  
Old 06-14-10, 06:11
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by djuritz View Post
Is there any function to return data like this ?
yes, the GROUP_CONCAT function
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 06-14-10, 16:35
djuritz djuritz is offline
Registered User
 
Join Date: Sep 2005
Posts: 67
Quote:
Originally Posted by r937 View Post
yes, the GROUP_CONCAT function

Thanks!!
That's what I needed! :-)
Reply With Quote
Reply

Tags
supermarket basket

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On