Answers.Body: <p>First create a Temp table with same structure and move all the data to the temp table. And then create a new column X and merge both the column A and B together and insert the values into the new column X</p>
  
  <p>And once you are happy with the merge column X move the same against custom table matching with the entity ID - Job done </p>
  
  <p>Please refer to the below link for Example 
  <a href="http://www.tutorialspoint.com/mysql/mysql-concat-function.htm" rel="nofollow">http://www.tutorialspoint.com/mysql/mysql-concat-function.htm</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-02T11:35:45.917Z
Answers.Text: Are you looking for the SQL - And I guess you are trying to do this in the Database Level - right ?
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-02T11:47:06.660Z
Answers.Text: Yes i will do this at the database level, have not started yet and will update you here.
Answers.UserDisplayName: Kboy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-10T09:59:07.873Z
Answers.Text: Hi Ramesh, i decided to do it manually, for all activities with option A or B, i changed it manually to option C and after the process i disabled options A and B.
Answers.UserDisplayName: Kboy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-02T10:09:22.633Z
Answers.LastActivityDate: 2016-03-02T10:09:22.633Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.Body: <p>A non-db solution for others who might read this would be to do an export of the contact-id (assuming these are contact fields), then in a spreadsheet use a CONCAT or CONCATENATE formula to get all the data in to a single cell with commas inbetween - don't worry if you end up with 2 commas adjacent etc, so the resulting cell might look like</p>
  
  <p>apple,banana</p>
  
  <p>apple,banana,carrot</p>
  
  <p>apple,,carrot</p>
  
  <p>Then, if you have added the new options to your field, you should be able to import this to 'update' the existing data in the field that you want the combined data to be stored in</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-03T19:09:43.963Z
Answers.LastActivityDate: 2016-03-03T19:09:43.963Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>Ramesh's answer is good, but you have to be very careful to be aware of the VALUE_SEPARATOR character - which by default is Unicode 0x0001.  In multi-option fields, there's a separation character at the beginning, end, and in between each option recorded in the database.  Most text editors won't render it, so it's easy to miss.</p>
  
  <p>This thread on the old CiviCRM forums discusses this issue:
  <a href="https://forum.civicrm.org/index.php?topic=24477.0" rel="nofollow">https://forum.civicrm.org/index.php?topic=24477.0</a></p>
  
  <p>I have a response on that thread that gives good advice for how to work with that character in MySQL: <a href="https://forum.civicrm.org/index.php?topic=24477.msg103328#msg103328" rel="nofollow">https://forum.civicrm.org/index.php?topic=24477.msg103328#msg103328</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-03T05:55:36.450Z
Answers.LastActivityDate: 2016-03-03T05:55:36.450Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I would like to merge some custom fields in my database. I have a set of custom fields and in this set i have a custom field with multiple options, I will like now to merge some option fields for this custom field.</p>
  
  <p>example: option field A = tomato|tomato , 
           option field B = apple|apple ,
           option field C = fruit|fruit ,</p>
  
  <p>I want to merge A and B to C, note that both A, B and C have data.</p>
  
  <p>Is this possible and how can i accomplish this without loosing any data?
  Civi version 4.5.5 and Drupal</p>
  
Tags: <custom-fields><duplicate-contacts>
Title: How can i merge custom fields?
ThreadText: # How can i merge custom fields?
  
  (Asked by: username_0 on 2016-03-02)
  
  I would like to merge some custom fields in my database. I have a set of custom fields and in this set i have a custom field with multiple options, I will like now to merge some option fields for this custom field.
  
  example: option field A = tomato|tomato ,
  option field B = apple|apple ,
  option field C = fruit|fruit ,
  
  I want to merge A and B to C, note that both A, B and C have data.
  
  Is this possible and how can i accomplish this without loosing any data?
  Civi version 4.5.5 and Drupal
  
  **Tags:** custom-fields, duplicate-contacts
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-03-02. Score: 1
  
  First create a Temp table with same structure and move all the data to the temp table. And then create a new column X and merge both the column A and B together and insert the values into the new column X
  
  And once you are happy with the merge column X move the same against custom table matching with the entity ID - Job done
  
  Please refer to the below link for Example
  <http://www.tutorialspoint.com/mysql/mysql-concat-function.htm>
  
  > **Comments:**
  > **username_1**: Are you looking for the SQL - And I guess you are trying to do this in the Database Level - right ?  
  > **username_0**: Yes i will do this at the database level, have not started yet and will update you here.  
  > **username_0**: Hi username_1, i decided to do it manually, for all activities with option A or B, i changed it manually to option C and after the process i disabled options A and B.  
  
  ---
  
  ### Answer by username_2 on 2016-03-03. Score: 0
  
  A non-db solution for others who might read this would be to do an export of the contact-id (assuming these are contact fields), then in a spreadsheet use a CONCAT or CONCATENATE formula to get all the data in to a single cell with commas inbetween - don't worry if you end up with 2 commas adjacent etc, so the resulting cell might look like
  
  apple,banana
  
  apple,banana,carrot
  
  apple,,carrot
  
  Then, if you have added the new options to your field, you should be able to import this to 'update' the existing data in the field that you want the combined data to be stored in
  
  
  ---
  
  ### Answer by username_3 on 2016-03-03. Score: 0
  
  username_1's answer is good, but you have to be very careful to be aware of the VALUE\_SEPARATOR character - which by default is Unicode 0x0001. In multi-option fields, there's a separation character at the beginning, end, and in between each option recorded in the database. Most text editors won't render it, so it's easy to miss.
  
  This thread on the old CiviCRM forums discusses this issue:
  <https://forum.civicrm.org/index.php?topic=24477.0>
  
  I have a response on that thread that gives good advice for how to work with that character in MySQL: <https://forum.civicrm.org/index.php?topic=24477.msg103328#msg103328>
  
  
  ---
  
  