2014-07-16 11:02:39
0
Here i have to update the table as follows,
My table looks like,
| subject | Type | Gender | s1 | s2 | s3 | s4 | s5 | s6 |
| sub1 | 1 | M | 10 | 20 | 0 | 0 | 0 | 0 |
| sub1 | 1 | F | 11 | 22 | 0 | 0 | 0 | 0 |
| sub1 | 2 | M | 30 | 40 | 0 | 0 | 0 | 0 |
| sub2 | 1 | M | 50 | 60 | 0 | 0 | 0 | 0 |
.
.
.
| subn | 2 | F | 500 | 600 | 0 | 0 | 0 | 0 |
here i have another table 2,
| subject | Type | Gender | s1| s2| s3 | s4 | s5 | s6 |
| sub1 | 1 | M | 0 | 0 | 11 | 16 | 25 | 30 |
| sub1 | 1 | F | 0 | 0 | 12 | 17 | 24 | 29 |
| sub1 | 2 | M | 0 | 0 | 13 | 18 | 23 | 28 |
| sub1 | 2 | F | 0 | 0 | 14 | 19 | 22 | 27 |
| sub2 | 1 | M | 0 | 0 | 15 | 20 | 21 | 26 |
.
.
.
| subn | 2 | F | 0 | 0 | 50 | 60 | 70 | 80 |
I need to update the values in table 1 from table 2. Don't look the values it's sample. Note: Extra rows may be less or more in both tables. If the row is not avail in table 1, have to identify and insert that row too in table 1 from table 2. If you need any queries regarding this i am here. thanks in advance.