I have a db where I have been given data comprised of 3 different ordering systems.
2 of these are old and 1 is our present system and I will be receiving updated data to enter into the database.
I intend to have a 1:Many relationship between tblCustomers and tblOrders. Then have a 1:many relationship between tblOrders and tblOrderlines. My structure will be as at the bottom of this post.
There are some duplications of customers and orders that I need to remove.
Normally, I would copy the structure only and append however, as an example, one duplicated record has extra fields and data that I wish to keep yet there are fields and data in the other duplicate record.
I am a little stuck on how best to proceed.
Here is an example:
(formatting will be out I think)
Step5 Find duplicates for tblOrders
OrderURN orderValue orderstatus
Record1 128
Record2 2001117 4.99
So here, I have orderurn and ordervalue in one record and orderstatus in another. I want to deduped but keep all the data in the fields. Haven’t got a clue how to do it unfortunately!
So, if anyone cal help I would be very happy indeed!
Thanks
PK= Primary Key/ FK= Foreign Key
* tblCustomers
g_user_id
source_customer_id
PK new_user_id
* tblOrders
customer_guid
source_customer_id
fk new_user_id
order_group_id
PK new_order_id
* tblOrderlines
order_number
order_id
fk new_order_id
2 of these are old and 1 is our present system and I will be receiving updated data to enter into the database.
I intend to have a 1:Many relationship between tblCustomers and tblOrders. Then have a 1:many relationship between tblOrders and tblOrderlines. My structure will be as at the bottom of this post.
There are some duplications of customers and orders that I need to remove.
Normally, I would copy the structure only and append however, as an example, one duplicated record has extra fields and data that I wish to keep yet there are fields and data in the other duplicate record.
I am a little stuck on how best to proceed.
Here is an example:
(formatting will be out I think)
Step5 Find duplicates for tblOrders
OrderURN orderValue orderstatus
Record1 128
Record2 2001117 4.99
So here, I have orderurn and ordervalue in one record and orderstatus in another. I want to deduped but keep all the data in the fields. Haven’t got a clue how to do it unfortunately!
So, if anyone cal help I would be very happy indeed!
Thanks
PK= Primary Key/ FK= Foreign Key
* tblCustomers
g_user_id
source_customer_id
PK new_user_id
* tblOrders
customer_guid
source_customer_id
fk new_user_id
order_group_id
PK new_order_id
* tblOrderlines
order_number
order_id
fk new_order_id