Dear Codegurus,
How do I updatezz data from 2 rows to 2 columns?
tool: vb.net
server: MySQL (SQLyog)
I have 2 tables, membercardlist and memberinfo:
table membercardlist:
------------- ------------ ------------
| AccountNo | CardNo | status |
------------- ------------ ------------
| 9999 | B009 | inactive |
------------- ------------ ------------
| 9999 | C009 | inactive |
------------- ------------ ------------
| 9999 | C009 | active |
------------- ------------ ------------
table memberinfo:
-------- ------------- ------------ ------------ ------------ ------------
| Name | AccountNo | MainCard | SubCard1 | SubCard2 | Expiry |
-------- ------------- ------------ ------------ ------------ ------------
| Chilly | 9999 | A009 | (null) | (null) | 11/2011 |
-------- ------------- ------------ ------------ ------------ ------------
How do I insert B009 and C009 from membercardlist into memberinfo like this:
result:
-------- ------------- ------------ ------------ ------------ ------------
| Name | AccountNo | MainCard | SubCard1 | SubCard2 | Expiry |
-------- ------------- ------------ ------------ ------------ ------------
| Chilly | 9999 | A009 | B009 | C009 | 11/2011 |
-------- ------------- ------------ ------------ ------------ ------------
please help me.