Thendral.N,
Take a look at your datatable structure:
Field1 | Field ... | Field26 | Field27 |
---|
updateddate1 | ... | updateddate26 | updateddate27 |
MPN1 | ... | MPN26 | MPN27 |
Merchant1 | ... | Merchant26 | Merchant27 |
Baseprice1 | ... | Baseprice26 | Baseprice27 |
Shipping1 | ... | Shipping26 | Shipping27 |
Tax1 | ... | Tax26 | Tax27 |
BLPrice1 | ... | BLPrice26 | BLPrice27 |
And what you see? Duplicated fields! You need to move some columns into another table.
Take a look at [
^] SQL excercises and
download[
^] Northwind database (install it). You need to understand how the database works and how to design it.
Then re-design your database!
For example:
Main table columns:
ID --> Primary Key (PK) of Main table<br />
...<br />
other columns/fields<br />
...
Details columns
DetID --> Primary Key Of Details table, autoincrement<br />
MainID --> Foreign Key (FK) = PK in Main<br />
updateddate<br />
MPN<br />
Merchant<br />
Baseprice<br />
Shipping<br />
Tax<br />
BLPrice
After creation of
Details
table, use queries like these:
INSERT INTO Detail (MainID, updateddate, MPN, Merchant, Baseprice, Shipping, Tax, BLPrice)
SELECT ID AS MainID, updateddate1 AS updateddate, MPN1 AS MPN, Merchant1 AS Merchant, Baseprice1 AS Baseprice, Shipping1 AS Shipping, Tax1 AS Tax, BLPrice1 AS BLPrice
FROM Main
...
INSERT INTO Detail (MainID, updateddate, MPN, Merchant, Baseprice, Shipping, Tax, BLPrice)
SELECT ID AS MainID, updateddate2 AS updateddate, MPN2 AS MPN, Merchant2 AS Merchant, Baseprice2 AS Baseprice, Shipping2 AS Shipping, Tax2 AS Tax, BLPrice2 AS BLPrice
FROM Main
and so on, untill 25(27?)...