title: i want to retrieve records for containedgroupid corresponding to groupid
body: <p>Here i show one table i want to retrieve containedgroupid corresponding to groupid </p>
  
  <p>This is my query</p>
  
  <pre><code>select groupname,containedgroupid 
  from groups g1 
  where (select 
  containedgroupid 
  from groups g2 
  where g1.containedgroupid=g2.containedgroupid);
  
  +---------+----------------+------------------+
  | groupid | groupname      | containedgroupid |
  +---------+----------------+------------------+
  |       0 | ANDHRA PRADESH |                0 |
  |       1 | KERALA         |                5 |
  |       2 | TAMILNADU      |                4 |
  |       3 | MADHYAPRADESH  |                3 |
  |       4 | PUNJAB         |                3 |
  |       5 | CHENNAI        |                2 |
  |       6 | KARNATAKA      |                2 |
  |       7 | MAHARASTRA     |                1 |
  |       8 | HARYANA        |                5 |
  +---------+----------------+------------------+
  </code></pre>