field1: abcd field2: 1111
I'd like to have:
Can you help me?
UPDATE table SET field3 = CONCAT(field1, field2)
Check out this list of string functions. This concatenation can be done automatically by adding BEFORE triggers on INSERT and UPDATE.
Within the trigger, set
NEW.field3 = CONCAT(NEW.field1, NEW.field2)
You can find out more about triggers in MySQL at: http://dev.mysql.com/doc/refman/5.0/en/triggers.html.
Related Q&A from Scott Noyes
Get suggestions for choosing MySQL character sets and field collations from expert Scott Noyes.continue reading
A MySQL expert describes two ways that the multi-master support can be used.continue reading
An expert describes where to find information on detection deadlock algorithms in MySQL.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.