title: Select specific rows and columns from an MySQL database
body: <p>I'm currently doing a student attendance program using c# and MySQL.</p>
  <p>I created a database called <code>std_info</code> where it keeps students information and there are <code>nibm_id, nic, name,address,number,batch</code> in that table</p>
  <p>2nd table name is <code>std_att</code> to get student attendance and the columns are <code>nibm_id, nic, name, batch</code></p>
  <p>What i want is to retrive only <code>nibm_id, nic, name, batch</code> from <code>std_info</code> table to <code>std_att</code>
  The primary key is <code>nibm_id</code></p>
  <p>here is what i was trying to do so far</p>
  <pre><code>cmd.CommandText = &quot;insert into std_att (nibm_id, nic, name, batch) SELECT * (nibm_id, nic, name, batch)  FROM `std_info` where nibm_id like '&quot; + textBox1.Text + &quot;%'&quot;;
  </code></pre>
  <p>Please show me a way to do this. Thank You!</p>