I have a table tblCustomers in a one-to-many relationship with table
tblProducts.
What I want to do is to create a stored procudure that returns a list
of each customer in tblCustomers but also creates a field showing a
string (separated by commas)of each matching record in tblProducts.
So the return would look like:
CustID Customer ProductList
1 Smith Apples, Oranges, Pears
2 Jones Pencils, Pens, Paper
etc...
Instead of:
CustID Customer Product
1 Smith Apples
1 Smith Oranges
1 Smith Pears
2 Jones Pencils
2 Jones Pens
2 Jones Paper
Which is what you get with this:
SELECT tblCusomers.Cus tID, tblCusomers.Cus tomer,
tblProducts.Pro duct
FROM
tblCusomers INNER JOIN
tblProducts ON
tblCustomers.Cu stID = tblProducts.Cus tID
I'd appreciate any help!
lq
tblProducts.
What I want to do is to create a stored procudure that returns a list
of each customer in tblCustomers but also creates a field showing a
string (separated by commas)of each matching record in tblProducts.
So the return would look like:
CustID Customer ProductList
1 Smith Apples, Oranges, Pears
2 Jones Pencils, Pens, Paper
etc...
Instead of:
CustID Customer Product
1 Smith Apples
1 Smith Oranges
1 Smith Pears
2 Jones Pencils
2 Jones Pens
2 Jones Paper
Which is what you get with this:
SELECT tblCusomers.Cus tID, tblCusomers.Cus tomer,
tblProducts.Pro duct
FROM
tblCusomers INNER JOIN
tblProducts ON
tblCustomers.Cu stID = tblProducts.Cus tID
I'd appreciate any help!
lq
Comment