I have a DB that we built a few years ago that we're placing into an RDB. I want the following:
PlantName PlantNumber Customer ProductNumber Product
________________________________________________________
________________________________________________________
Loc A 1000 Joe's 123456 Pizza 1
________________________________________________________
Loc B 2000 Jerry's 654321 Pizza 2
Which is one table, to go into a new database with Plants
, Customers
and Products
Tables. I have the Customers
table already worked out:
CustomerID CustomerName
____________________________
____________________________
987 Joe's
____________________________
789 Jerry's
And I want the Products
Table to look as such
ProductID CustomerID ProductName
_______________________________________
_______________________________________
123456 987 Pizza 1
_______________________________________
654321 789 Pizza 2
So my question is, how can I create an INSERT
Statement to get the CustomerID
from the Customers
Table? I would need to select both from the old Products
Table and the new Customers
Table to ge the ProductID
and the CustomerID
values.