Hi,

I have a question about MySQL queries. First I will explain the situation,
then I will provide an example.


Situation:

I have the tables 'offer', 'contact' and 'offer_contact'. Table 'offer'
contains data about offers, table 'contact' about contacts. Table
'offer_contact' tells which contacts are associated with which offers (since
offers can have multiple contacts associated with it and vice versa). Now I
want to run a query so I get a row for each offer and in the result there's
a field 'offer_contacts' which contains all the names of the contacts
associated with the offer on that row separated by comma's.


Example:

Table 'offer' (offer_id - offer_title):
1 - Test
2 - Also test

Table 'contact' (contact_id - contact_name):
1 - John
2 - Anna

Table 'offer_contact' (offer_id - contact_id):
1 - 1
1 - 2
2 - 1

Wanted result of query (offer_id - offer_name - offer_contacts):
1 - Test - John, Anna
2 - Also test - John


Is this possible?
Your help would be great!
--
Klaas Geldof


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to