MySQL Forums
Forum List  »  Triggers

Re: Comma delimiters in one field
Posted by: Peter Brawley
Date: March 04, 2011 10:00AM

Quote

I have values in a field which are separated in by a commma but I also need another field to be an indentifier for these.
I have this ......
Customer Name Products
Customer 1 Product 1, Product 2
Customer 2 Product 1, Product 2,Product 3
Customer 3 Product 1, Product 2,Product 3,Product 4

Can't work, breaks a cardinal rule of relational database design, atomicity, ie one value per cell. You need multiple related tables eg ...

customer(id PK, name, address, ...)
products(id PK, name, baseprice, ...)
customers_products(id PK,custID references customers(id),prodID references products(id),...)

PB
http://www.artfulsoftware.com

Options: Reply• Quote


Subject
Views
Written By
Posted
2607
March 03, 2011 08:19AM
Re: Comma delimiters in one field
1318
March 04, 2011 10:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.