Answers.Body: <p>Before doing either of the following approaches, make sure to backup your database.</p>
  
  <p>Both methods assume you have created the new custom fieldset group in the browser before beginning.</p>
  
  <p><strong>Export and Import</strong></p>
  
  <p>The first method is done through the browser, and the instructions are a high-level summary of what needs to be done. </p>
  
  <ol>
  <li>Create a new second field in the other custom fieldset. You'll need to use a different name when creating the second field that was used when creating the first field. (After you have created the second field, you can change its name back to what was used for the first field.) If the field has option values, make sure to use the same set of options.</li>
  <li>Export data from the first field including the contact id, </li>
  <li>Import data into the second field.</li>
  <li>Review the data to make sure everything looks right.</li>
  <li>Delete the first field.</li>
  </ol>
  
  <p><strong>Change the field location in the schema (Expert SQL skills required)</strong></p>
  
  <p>This method can be used to avoid long exports and imports, as well as inadvertent errors in configuring fields the same through the browser. </p>
  
  <p>Make sure to take your site offline while modifying the schema as below.</p>
  
  <p>In this approach, we create new field(s) in the table holding the data for the new fieldset, copy the data over, move the fields from the old to the new group, review the data, then delete the old field(s). As an example, we're going to move fields from an Applicant custom fieldset to a new Student fieldset.</p>
  
  <ol>
  <li><p>Find the custom field ID and the custom fieldset group ID in one of two ways. </p>
  
  <ol>
  <li>In a browser, navigate to Administer > Custom Data and Screens > Custom Fields, then beside the relevant fieldset click View and Edit Custom Fields, then beside the relevant field, hover over Edit field and observe the url your browser displays (or open a new tab for that url). In the url, you'll see gid=xx and id=yy, where xx is the fieldset group id and yy is the field id. </li>
  <li><p>In MySQL either on a command line, via phpMyAdmin, or some similar tool, list the custom fieldset groups with:</p>
  
  <p>mysql> SELECT id, name, title, extends FROM civicrm_custom_group;</p>
  
  <p>Note the fieldset group id numbers of the old and new groups you want, say gg1 and gg2. Then run:</p>
  
  <p>mysql> SELECT id, name, label FROM civicrm_custom_field WHERE custom_group_id=gg1;</p>
  
  <p>Note the field id number you want, say ff.</p></li>
  </ol></li>
  <li><p>There is a table for each custom fieldset named civicrm_value_GGG_gg, where gg is the group id, and GGG is its civicrm_custom_group.name. I find it is easiest to get the table name by copying it into my clipboard from the list of tables in the database. From the mysql command line:</p>
  
  <p>mysql> SHOW TABLES;</p></li>
  <li><p>Display the definition of the table so we can copy one or more field definitions into the new table, for example:</p>
  
  <p>mysql> SHOW CREATE TABLE civicrm_value_applicants_11;</p>
  
  <p>| civicrm_value_applicants_11 | CREATE TABLE <code>civicrm_value_applicants_11</code> (</p>
  
  <p><code>id</code> int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Default MySQL primary key',</p>
  
  <p><code>entity_id</code> int(10) unsigned NOT NULL COMMENT 'Table that this extends',</p>
  
  <p><code>student_number_18</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>application_stage_19</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>academic_program_20</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>start_term_21</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>residency_22</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>application_type_23</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>academic_level_24</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>rtw__25</code> tinyint(4) DEFAULT NULL,</p>
  
  <p><code>applicant_type_52</code> double DEFAULT NULL,</p>
  
  <p>PRIMARY KEY (<code>id</code>),</p>
  
  <p>UNIQUE KEY <code>unique_entity_id</code> (<code>entity_id</code>),</p>
  
  <p>KEY <code>INDEX_application_stage_19</code> (<code>application_stage_19</code>),</p>
  
  <p>CONSTRAINT <code>FK_civicrm_value_applicants_11_entity_id</code> FOREIGN KEY (<code>entity_id</code>) REFERENCES <code>civicrm_contact</code> (<code>id</code>) ON DELETE CASCADE</p>
  
  <p>) ENGINE=InnoDB AUTO_INCREMENT=3337 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |</p>
  
  <ol start="4">
  <li>Here's the table we are copying fields into:</li>
  </ol>
  
  <p>mysql> show create table civicrm_value_students_37;</p>
  
  <p>| civicrm_value_students_37 | CREATE TABLE <code>civicrm_value_students_37</code> (</p>
  
  <p><code>id</code> int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Default MySQL primary key',</p>
  
  <p><code>entity_id</code> int(10) unsigned NOT NULL COMMENT 'Table that this extends',</p>
  
  <p>PRIMARY KEY (<code>id</code>),</p>
  
  <p>UNIQUE KEY <code>unique_entity_id</code> (<code>entity_id</code>),</p>
  
  <p>CONSTRAINT <code>FK_civicrm_value_students_37_entity_id</code> FOREIGN KEY (<code>entity_id</code>) REFERENCES <code>civicrm_contact</code> (<code>id</code>) ON DELETE CASCADE</p>
  
  <p>) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |</p>
  
  <ol start="5">
  <li>Using relevant field definitions from the first table, run the following query:</li>
  </ol>
  
  <p>mysql> ALTER TABLE civicrm_value_students_37</p>
  
  <p>ADD COLUMN (</p>
  
  <p><code>student_number_18</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>academic_program_20</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>start_term_21</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>residency_22</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>academic_level_24</code> varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,</p>
  
  <p><code>rtw__25</code> tinyint(4) DEFAULT NULL</p>
  
  <p>);</p>
  
  <ol start="6">
  <li>Copy the data over. If the fieldset receiving the data exists for some or all of the relevant records, then you will need to run an update query along the following lines</li>
  </ol>
  
  <p>mysql> UPDATE civicrm_value_students_37 s </p>
  
  <p>INNER JOIN civicrm_value_applicants_11 a </p>
  
  <p>ON s.entity_id=a.entity_id </p>
  
  <p>SET</p>
  
  <p>s.student_number_18=a.student_number_18,</p>
  
  <p>s.academic_program_20=a.academic_program_20,</p>
  
  <p>s.start_term_21=a.start_term_21,</p>
  
  <p>s.residency_22=a.residency_22,</p>
  
  <p>s.academic_level_24=a.academic_level_24,</p>
  
  <p>s.rtw__25=a.rtw__25;</p>
  
  <ol start="7">
  <li>Insert the data if appropriate. If some or all of the records in the old fieldset do not exist in the new fieldset, you'll need to run an insert query along the following lines:</li>
  </ol>
  
  <p>mysql> INSERT INTO civicrm_value_students_37 (entity_id, student_number_18, academic_program_20, start_term_21, residency_22, academic_level_24, rtw__25)</p>
  
  <p>SELECT a.entity_id, a.student_number_18, a.academic_program_20, a.start_term_21, a.residency_22, a.academic_level_24, a.rtw__25 </p>
  
  <p>FROM civicrm_value_applicants_11 a </p>
  
  <p>LEFT JOIN civicrm_value_students_37 s </p>
  
  <p>ON a.entity_id=s.entity_id </p>
  
  <p>WHERE s.entity_id IS NULL;</p>
  
  <p>NB: FYI the LEFT JOIN ... WHERE ... IS NULL selects records that exist in the old table but not the new one.</p>
  
  <ol start="8">
  <li>This step is the first action that changes what appears through the browser. Update the fieldset group that these fields are in:</li>
  </ol>
  
  <p>mysql> UPDATE civicrm_custom_field SET custom_group_id=11 WHERE id IN (18, 20, 21, 22, 24, 25);</p>
  
  <ol start="9">
  <li>After checking the data in the browser, remove cruft from the first database table:</li>
  </ol>
  
  <p>mysql> ALTER TABLE civicrm_value_applicants_11 </p>
  
  <p>DROP COLUMN student_number_18, </p>
  
  <p>DROP COLUMN academic_program_20, </p>
  
  <p>DROP COLUMN start_term_21, </p>
  
  <p>DROP COLUMN residency_22, </p>
  
  <p>DROP COLUMN academic_level_24, </p>
  
  <p>DROP COLUMN rtw__25;</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-08T04:56:26.833Z
Answers.Text: Hi Joe thank you this is SO useful. Part 6 worked perfectly. Part 7 gave error "#1136 - Column count doesn't match value count at row 1. Do I have to include all fields in row 1, including those that will not be receiving any data?
Answers.UserDisplayName: LesleyJill
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-08T05:03:45.217Z
Answers.Text: This is query and error                             INSERT INTO civicrm_value_learner_statu_110 (venue_where_mentored_552)
  
  SELECT a.entity_id, a.venue_where_mentored_552
  
  FROM civicrm_value_dex_data_77 a
  
  LEFT JOIN civicrm_value_learner_statu_110 s
  
  ON a.entity_id=s.entity_id
  
  WHERE s.entity_id IS NULL
  MySQL said: Documentation
  
  #1136 - Column count doesn't match value count at row 1
Answers.UserDisplayName: LesleyJill
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-09T15:08:19.217Z
Answers.Text: Your query is inserting a single field but selecting two fields to put into it. You actually need to have the entity_id field too. So try 'INSERT INTO civicrm_value_learner_statu_110 (entity_id, venue_where_mentored_552) SELECT a.entity_id, a.venue_where_mentored_552 FROM civicrm_value_dex_data_77 a LEFT JOIN civicrm_value_learner_statu_110 s ON a.entity_id=s.entity_id WHERE s.entity_id IS NULL'
Answers.UserDisplayName: Joe Murray
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T20:17:11.497Z
Answers.LastActivityDate: 2015-07-20T20:17:11.497Z
Answers.UserDisplayName: Joe Murray
Answers.Body: <p>Mostly you will want to move fields between customs fields sets used for the same entity (ie from one custom field set used for participants to another custom field set used for participants.)</p>
  
  <p>This can be done easily through the UI as follows:</p>
  
  <ol>
  <li>Go to <strong>Administer > Customize Data and Screens > Custom Fields</strong></li>
  <li>If it doesn't already exist create the new field set.</li>
  <li>Return to <strong>Administer > Customize Data and Screens > Custom Fields</strong> and select <strong>View and Edit Custom Fields</strong> for the field set containing the field you want to move.</li>
  <li>On the far right of the row containing the field you want to move click on <strong>More > Move</strong>. </li>
  <li>Select the the new field set.</li>
  </ol>
  
  <p>However, if you want to move a field from a field set used for <strong>Individuals</strong> to a field set used for <strong>Contacts</strong> or vice versa you will get an error message "The destination group extends a different entity type." </p>
  
  <p>In that situation or similar involving a single branch of contact subtypes:</p>
  
  <ol>
  <li>Back up your database.</li>
  <li>Using phpMyAdmin or otherwise, in <strong>civicrm_custom_group</strong>
  find the field set with the most restricted contact type and edit the <strong>Extends</strong> field to match the value in the field set with the least restricted contact type. (eg change "Individual" to "Contact".)</li>
  <li>In the UI move the field as described above.</li>
  <li>Using phpMyAdmin or otherwise change the <strong>Extends</strong> value you altered in 2. back to it's original value.</li>
  </ol>
  
  <p>NOTE: 1. I haven't tried moving fields between a field set used for Organizations and one used for Individuals.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-17T11:31:07.823Z
Answers.Text: If it's OK to move fields from e.g. Organization to Contact, why not enable it through the UI?
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-20T23:43:36.683Z
Answers.LastActivityDate: 2015-07-21T00:32:01.550Z
Answers.LastEditDate: 2015-07-21T00:32:01.550Z
Answers.UserDisplayName: JoAnne
Body: <p>Sometimes one needs to rejig which fieldset contains one or more fields after data has been entered in them. For example, you create a new contact subtype and you want to move some but not all of the custom fields in an existing custom fieldset to a custom fieldset for the new contact subtype. You might need to do this when consolidating fieldsets, or just so the fields appear under a more appropriate title when you have several fieldsets for the same objects.</p>
  
  <p>What's the best way to move a custom contact field and its data to a different fieldset?</p>
  
Tags: <custom-fields>
Title: How should I move a custom field to a different custom fieldset?
ThreadText: # How should I move a custom field to a different custom fieldset?
  
  (Asked by: username_0 on 2015-07-20)
  
  Sometimes one needs to rejig which fieldset contains one or more fields after data has been entered in them. For example, you create a new contact subtype and you want to move some but not all of the custom fields in an existing custom fieldset to a custom fieldset for the new contact subtype. You might need to do this when consolidating fieldsets, or just so the fields appear under a more appropriate title when you have several fieldsets for the same objects.
  
  What's the best way to move a custom contact field and its data to a different fieldset?
  
  **Tags:** custom-fields
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-07-20. Score: 10 | Accepted answer
  
  Mostly you will want to move fields between customs fields sets used for the same entity (ie from one custom field set used for participants to another custom field set used for participants.)
  
  This can be done easily through the UI as follows:
  
  1. Go to **Administer > Customize Data and Screens > Custom Fields**
  2. If it doesn't already exist create the new field set.
  3. Return to **Administer > Customize Data and Screens > Custom Fields** and select **View and Edit Custom Fields** for the field set containing the field you want to move.
  4. On the far right of the row containing the field you want to move click on **More > Move**.
  5. Select the the new field set.
  
  However, if you want to move a field from a field set used for **Individuals** to a field set used for **Contacts** or vice versa you will get an error message "The destination group extends a different entity type."
  
  In that situation or similar involving a single branch of contact subtypes:
  
  1. Back up your database.
  2. Using phpMyAdmin or otherwise, in **civicrm\_custom\_group**
     find the field set with the most restricted contact type and edit the **Extends** field to match the value in the field set with the least restricted contact type. (eg change "Individual" to "Contact".)
  3. In the UI move the field as described above.
  4. Using phpMyAdmin or otherwise change the **Extends** value you altered in 2. back to it's original value.
  
  NOTE: 1. I haven't tried moving fields between a field set used for Organizations and one used for Individuals.
  
  > **Comments:**
  > **username_3**: If it's OK to move fields from e.g. Organization to Contact, why not enable it through the UI?  
  
  ---
  
  ### Answer by username_0 on 2015-07-20. Score: 2
  
  Before doing either of the following approaches, make sure to backup your database.
  
  Both methods assume you have created the new custom fieldset group in the browser before beginning.
  
  **Export and Import**
  
  The first method is done through the browser, and the instructions are a high-level summary of what needs to be done.
  
  1. Create a new second field in the other custom fieldset. You'll need to use a different name when creating the second field that was used when creating the first field. (After you have created the second field, you can change its name back to what was used for the first field.) If the field has option values, make sure to use the same set of options.
  2. Export data from the first field including the contact id,
  3. Import data into the second field.
  4. Review the data to make sure everything looks right.
  5. Delete the first field.
  
  **Change the field location in the schema (Expert SQL skills required)**
  
  This method can be used to avoid long exports and imports, as well as inadvertent errors in configuring fields the same through the browser.
  
  Make sure to take your site offline while modifying the schema as below.
  
  In this approach, we create new field(s) in the table holding the data for the new fieldset, copy the data over, move the fields from the old to the new group, review the data, then delete the old field(s). As an example, we're going to move fields from an Applicant custom fieldset to a new Student fieldset.
  
  1. Find the custom field ID and the custom fieldset group ID in one of two ways.
  
     1. In a browser, navigate to Administer > Custom Data and Screens > Custom Fields, then beside the relevant fieldset click View and Edit Custom Fields, then beside the relevant field, hover over Edit field and observe the url your browser displays (or open a new tab for that url). In the url, you'll see gid=xx and id=yy, where xx is the fieldset group id and yy is the field id.
     2. In MySQL either on a command line, via phpMyAdmin, or some similar tool, list the custom fieldset groups with:
  
        mysql> SELECT id, name, title, extends FROM civicrm\_custom\_group;
  
        Note the fieldset group id numbers of the old and new groups you want, say gg1 and gg2. Then run:
  
        mysql> SELECT id, name, label FROM civicrm\_custom\_field WHERE custom\_group\_id=gg1;
  
        Note the field id number you want, say ff.
  2. There is a table for each custom fieldset named civicrm\_value\_GGG\_gg, where gg is the group id, and GGG is its civicrm\_custom\_group.name. I find it is easiest to get the table name by copying it into my clipboard from the list of tables in the database. From the mysql command line:
  
     mysql> SHOW TABLES;
  3. Display the definition of the table so we can copy one or more field definitions into the new table, for example:
  
     mysql> SHOW CREATE TABLE civicrm\_value\_applicants\_11;
  
     | civicrm\_value\_applicants\_11 | CREATE TABLE `civicrm_value_applicants_11` (
  
     `id` int(10) unsigned NOT NULL AUTO\_INCREMENT COMMENT 'Default MySQL primary key',
  
     `entity_id` int(10) unsigned NOT NULL COMMENT 'Table that this extends',
  
     `student_number_18` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `application_stage_19` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `academic_program_20` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `start_term_21` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `residency_22` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `application_type_23` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `academic_level_24` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `rtw__25` tinyint(4) DEFAULT NULL,
  
     `applicant_type_52` double DEFAULT NULL,
  
     PRIMARY KEY (`id`),
  
     UNIQUE KEY `unique_entity_id` (`entity_id`),
  
     KEY `INDEX_application_stage_19` (`application_stage_19`),
  
     CONSTRAINT `FK_civicrm_value_applicants_11_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE
  
     ) ENGINE=InnoDB AUTO\_INCREMENT=3337 DEFAULT CHARSET=utf8 COLLATE=utf8\_unicode\_ci |
  
     4. Here's the table we are copying fields into:
  
     mysql> show create table civicrm\_value\_students\_37;
  
     | civicrm\_value\_students\_37 | CREATE TABLE `civicrm_value_students_37` (
  
     `id` int(10) unsigned NOT NULL AUTO\_INCREMENT COMMENT 'Default MySQL primary key',
  
     `entity_id` int(10) unsigned NOT NULL COMMENT 'Table that this extends',
  
     PRIMARY KEY (`id`),
  
     UNIQUE KEY `unique_entity_id` (`entity_id`),
  
     CONSTRAINT `FK_civicrm_value_students_37_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE
  
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8\_unicode\_ci |
  
     5. Using relevant field definitions from the first table, run the following query:
  
     mysql> ALTER TABLE civicrm\_value\_students\_37
  
     ADD COLUMN (
  
     `student_number_18` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `academic_program_20` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `start_term_21` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `residency_22` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `academic_level_24` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,
  
     `rtw__25` tinyint(4) DEFAULT NULL
  
     );
  
     6. Copy the data over. If the fieldset receiving the data exists for some or all of the relevant records, then you will need to run an update query along the following lines
  
     mysql> UPDATE civicrm\_value\_students\_37 s
  
     INNER JOIN civicrm\_value\_applicants\_11 a
  
     ON s.entity\_id=a.entity\_id
  
     SET
  
     s.student\_number\_18=a.student\_number\_18,
  
     s.academic\_program\_20=a.academic\_program\_20,
  
     s.start\_term\_21=a.start\_term\_21,
  
     s.residency\_22=a.residency\_22,
  
     s.academic\_level\_24=a.academic\_level\_24,
  
     s.rtw\_\_25=a.rtw\_\_25;
  
     7. Insert the data if appropriate. If some or all of the records in the old fieldset do not exist in the new fieldset, you'll need to run an insert query along the following lines:
  
     mysql> INSERT INTO civicrm\_value\_students\_37 (entity\_id, student\_number\_18, academic\_program\_20, start\_term\_21, residency\_22, academic\_level\_24, rtw\_\_25)
  
     SELECT a.entity\_id, a.student\_number\_18, a.academic\_program\_20, a.start\_term\_21, a.residency\_22, a.academic\_level\_24, a.rtw\_\_25
  
     FROM civicrm\_value\_applicants\_11 a
  
     LEFT JOIN civicrm\_value\_students\_37 s
  
     ON a.entity\_id=s.entity\_id
  
     WHERE s.entity\_id IS NULL;
  
     NB: FYI the LEFT JOIN ... WHERE ... IS NULL selects records that exist in the old table but not the new one.
  
     8. This step is the first action that changes what appears through the browser. Update the fieldset group that these fields are in:
  
     mysql> UPDATE civicrm\_custom\_field SET custom\_group\_id=11 WHERE id IN (18, 20, 21, 22, 24, 25);
  
     9. After checking the data in the browser, remove cruft from the first database table:
  
     mysql> ALTER TABLE civicrm\_value\_applicants\_11
  
     DROP COLUMN student\_number\_18,
  
     DROP COLUMN academic\_program\_20,
  
     DROP COLUMN start\_term\_21,
  
     DROP COLUMN residency\_22,
  
     DROP COLUMN academic\_level\_24,
  
     DROP COLUMN rtw\_\_25;
  
  > **Comments:**
  > **username_1**: Hi Joe thank you this is SO useful. Part 6 worked perfectly. Part 7 gave error "#1136 - Column count doesn't match value count at row 1. Do I have to include all fields in row 1, including those that will not be receiving any data?  
  > **username_1**: This is query and error                             INSERT INTO civicrm_value_learner_statu_110 (venue_where_mentored_552)  SELECT a.entity_id, a.venue_where_mentored_552  FROM civicrm_value_dex_data_77 a  LEFT JOIN civicrm_value_learner_statu_110 s  ON a.entity_id=s.entity_id  WHERE s.entity_id IS NULL MySQL said: Documentation  #1136 - Column count doesn't match value count at row 1  
  > **username_0**: Your query is inserting a single field but selecting two fields to put into it. You actually need to have the entity_id field too. So try 'INSERT INTO civicrm_value_learner_statu_110 (entity_id, venue_where_mentored_552) SELECT a.entity_id, a.venue_where_mentored_552 FROM civicrm_value_dex_data_77 a LEFT JOIN civicrm_value_learner_statu_110 s ON a.entity_id=s.entity_id WHERE s.entity_id IS NULL'  
  
  ---
  
  