Merging 2 mysql tables
Posted on 2014-02-14
I have 2 tables in a mysql database, both with 3 columns each.
ID | Text | Type
Table A is the main table, but all it's Type's are set to 0
Table B should be merged with Table A. A check should be made if table B's text field exists in Table A, if no, add the row (text and type value).
If the text from table B already does exist in Table A, only add/update the Type value to the corresponding row of table A.
How would i do this?