title: Mysql Join with distinct values
body: <p>Table Name : x</p>
  
  <p>id name 
  id  is primary key</p>
  
  <pre><code>1   xxxx
  2   yyyy
  </code></pre>
  
  <p>Table name : y <br />
  sno primary key
  id foreign key
  class</p>
  
  <pre><code>1 1 first 
  2 1  second
  </code></pre>
  
  <p>OUTPUT  <br /></p>
  
  <pre><code>id 
  xxxx first second
  </code></pre>
  
  <p>I do not want name to repeat for each row</p>
  
  <pre><code>SELECT x.name, y.class from x,y  WHERE x.id = y.id
  </code></pre>
  
  <p>This query output as xxxx first and xxxx second</p>