View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 09:35 AM
Peter H. Coffin
 
Posts: n/a
Default Re: SQL syntax problem

On 15 Nov 2006 10:18:56 -0800, reversed.K@gmail.com wrote:
> Hello!
>
> I've got a little problem with mySQL syntax.
>
> I have two tables : candidate and CV_items. Cardinality is : for 1
> candidate you can have multiple CV_items
>
> I'd like to Select in ONE SINGLE ROW the id of the candidate
> (id_candidate) and ALL the CV_items associated.
> so far I used : "SELECT * FROM candidate c RIGHT JOIN cv_items
> ON c.ID_CANDIDATE=cv.ID_CANDIDATE" , it gives me the infos I need BUT
> on separated rows .


The key word you're looking for is "pivot". I'll skip the rest of the
answer as I've never done them under MySQL.

--
Life does not cease to be funny when people die any more than it ceases
to be serious when people laugh.
-- George Bernard Shaw
Reply With Quote