title: How to copy multiple records from a certain column from a table to another table in a column with vary option in mysql
body: <p>How  to copy multiple records from a certain column from a table and insert to update another table in a column with vary option in mysql with a SQL command</p>
  
  <p>Column: "targetCategory" condition all records contain Top/name_test2, Top/name_test2/%</p>
  
  <p>column "title", "parentTopic refer data
  Note: Data have root diferent not import exemple: Top/name_test752</p>
  
  <pre><code>        table_exemple1
  
  
         ===========================================================================
         |    aliasID    |    title     |    targetCategory     |    parentTopic    |
         ===========================================================================
  No     |    1          | name_test752 | Top/name_test752/tel  | Top/name_test752  |
         ---------------------------------------------------------------------------
  |-&lt;----|    2          | name_test2   | Top/name_test2        | Top/name_test2    |
  |      ---------------------------------------------------------------------------
  ||-&lt;---|    3          | 5            | Top/name_test2/etc/5  | Top/name_test2/etc|
  ||      ---------------------------------------------------------------------------
  |||-&lt;--|    4          | tesla        |  Top/name_test2/tesla | Top/name_test2    |
  |||    ----------------------------------------------------------------------------
  |||
  |||
  |||    **tabla_exemple2 before update**
  |||    =====================================================================================================================================================================
  |||    |    id         |    topic              |    topicShort         |    parentTopic        |    displayName    |    description    |    lastUpdate        | sitecount  |
  |||    =====================================================================================================================================================================
  |||    |    1          | Top/name_test/helloo  | helloo                | Top/name_test752      |     Nuul          |     hello         | 2010-06-19 04:10:14  |  324       |
  |||    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |||    |    2          | Top/name_test2/nest   | nest                  | Top/name_test2/       |     Nuul          |      nest         | 2010-06-19 04:11:23  |  545435    |
  |||    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |||    |    3          | Top/name_test2/etc/57 | 5                     | Top/name_test2/etc/   |     Nuul          |      5            |  2010-06-19 04:15:13 |  54354343  |
  |||    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |||    |    4          | Top/name_test2/tesla1 | tesla                 |  Top/name_test2/      |     Nuul          |      tesla        |  2010-06-19 04:10:14 |  676756    |
  |||    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |||  
  |||
  |||  **table_exemple2** after update
  |||
  |||
  |||   =====================================================================================================================================================================
  |||    |    id         |    topic              |    topicShort         |    parentTopic        |    displayName    |    description    |    lastUpdate        | sitecount  |
  |||    =====================================================================================================================================================================
  |||    |    1          | Top/name_test/helloo  | helloo                | Top/name_test752      |     Nuul          |     hello         | 2010-06-19 04:10:14  |  324       |
  |||    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |||    |    2          | Top/name_test2/nest   | nest                  | Top/name_test2/       |     Nuul          |      nest         | 2010-06-19 04:11:23  |  545435    |
  |||    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |||    |    3          | Top/name_test2/etc/57 | 5                     | Top/name_test2/etc/   |     Nuul          |      5            |  2010-06-19 04:15:13 |  54354343  |
  |||    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |||    |    4          | Top/name_test2/tesla1 | tesla                 |  Top/name_test2/      |     Nuul          |      tesla        |  2010-06-19 04:10:14 |  676756    |
  |||    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |||---&gt;|    6          | Top/name_test2        | name_test2            | Top                   |     Nuul          |      name_test2   |  insert data         |  0         |
  |      ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |-----&gt;|    7          | Top/name_test2/etc/5  | 5                     | Top/name_test2/etc    |     Nuul          |      5            |  insert data         |  0         |
  |      ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |-----&gt;|    8          | Top/name_test2/tesla  | tesla                 | Top/name_test2        |     Nuul          |      tesla        |  insert data         |  0         |
         ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  
         Data from "targetCategory" wil goo to "topic"
         data from "title" goo to "topicShort"
         Data from "parentTopic" goo to "parentTopic"
         I ned insert new data to column "displayName" well be "Nuul"
         I ned insert new data to column "description" well be idem "topicShort"
         I ned insert new data to column "displayName" well be "Nuul"
         I ned insert new data to column "lastUpdate" well be "data time inserition"
         I ned insert new data to column "displayName" well be "0"
  
         condition its column targetCategory data like Top/name_test2 and like Top/name_test2/%
  </code></pre>