title: How to Display result of subquery rows as one column in MySQL?
body: <p>I have three tables Category, Movies and RelCatMov</p>
  
  <p><strong>Category-table</strong></p>
  
  <pre><code>    categoryid, categoryName
  1            thriller
  2            supsense
  3            romantic
  4            action
  5            sci-fi
  </code></pre>
  
  <p><strong>Movies-table</strong></p>
  
  <pre><code>movieid, movieName
  1            Avataar
  2            Titanic
  3            NinjaAssassin
  </code></pre>
  
  <p><strong>RelCatMov-table</strong></p>
  
  <pre><code>categoryid, MovieID
  1            1
  2            2
  3            2
  4            2
  5            2
  </code></pre>
  
  <p>Now i Want to display a the record as</p>
  
  <pre><code>MovieName     Categories
  Titanic    Suspense,Romantic,Sci-fi,action
  </code></pre>
  
  <p>How to do this.</p>
  
  <p>I am writing a query</p>
  
  <pre><code>select MovieName,(select categoryname from category b,relcatmov c where b.categoryid=c.categoryid and c.movieid=a.movieid) as categories from movies a;
  
  Error: Subquery returns more than one row!!!
  </code></pre>
  
  <p>How to display the result of rows in one column?</p>
  
  <p>Please help!!!</p>