bouvet
Posts: 24
|
Posted: 06/08/2004, 1:32 AM |
|
Hi,
I have a table product. I choose an article.
I want to insert this articel in a antoher table product1.
The 2 tables have the the structure. I just make a duplication.
Thanks
Philippe
_________________
Webdesign Hildesheim Hannover
http://www.actidesign.com |
|
|
RonB
Posts: 228
|
Posted: 06/08/2004, 3:08 AM |
|
Why? if you use a relational databse storing the same info twice is a big no no. Creates danger of data inconsistency.
|
|
|
Philippe
|
Posted: 06/08/2004, 3:30 AM |
|
Quote RonB:
Why? if you use a relational databse storing the same info twice is a big no no. Creates danger of data inconsistency.
because I have to choose the product first.
It's also because I didn't find a nother way
|
|
|
ghtracey
Posts: 23
|
Posted: 06/08/2004, 9:52 AM |
|
I think what Ron was trying to tell you is that if you store the ID column from the product table into the product1 table, you won't be storing the data twice, instead you reference the data.
Example:
Product Table:
ID | Name | Description | etc......
Product1 Table:
ID | Other Fields | ProductID
Now, in a query you can view the combined results of both tables with
SELECT * FROM product1 INNER JOIN product ON product1.ProductID=product.ID
I suggest you buy a book on SQL or do some online reading. This type of thing is the basis of a relational database, and is something you should understand before you attempt to code applications.
Cheers.
_________________
Graham Tracey
Council of Yukon First Nations |
|
|
Philippe
|
Posted: 06/08/2004, 9:58 AM |
|
Quote ghtracey:
I think what Ron was trying to tell you is that if you store the ID column from the product table into the product1 table, you won't be storing the data twice, instead you reference the data.
Example:
Product Table:
ID | Name | Description | etc......
Product1 Table:
ID | Other Fields | ProductID
Now, in a query you can view the combined results of both tables with
SELECT * FROM product1 INNER JOIN product ON product1.ProductID=product.ID
I suggest you buy a book on SQL or do some online reading. This type of thing is the basis of a relational database, and is something you should understand before you attempt to code applications.
Cheers.
Thank you, I get one but I am lazy or too stupid! in Fact I don't think I explain well my problem. I post a aonther subject. Pehraphs, you can read it
Philipppe
|
|
|
|