title: How to write Insert Query in Yii2?
body: <p>In Yii2 How to insert data from one table to another table.</p>
  
  <p>Here i have two tables <code>table1</code> and <code>table2</code>.</p>
  
  <p>Now what i need is when a condition met i need transfer a specific data from <code>table1</code> to <code>table2</code>.</p>
  
  <p>so help to write insert Query for this scenario in Yii2</p>
  
  <p>This is the insert query given in yii2 docs</p>
  
  <pre><code>Yii::$app-&gt;db-&gt;createCommand()
  -&gt;insert('user', [
  'name' =&gt; 'Sam',
  'age' =&gt; 30,
  ])-&gt;execute();
  </code></pre>
  
  <p>But i need this Query to be convert according Yii2 Query</p>
  
  <pre><code>INSERT INTO Customers (CustomerName, Country)
  SELECT SupplierName, Country FROM Suppliers;
  </code></pre>