I have two tables :
GererLocationAppart(IdAppartL, MatriculeEmploye)
Employe(MatriculeEmploye, PrenomEmploye, NomEmploye, NumeroTelephoneEmploye)
I would like to get a table wich contains "PrenomEmploye", "NomEmploye" and a column "Id AppartL". This last column should have the number of lines that every "MatriculeEmploye" are referring to. I know that i should do a mixture between
Select Distinct PrenomEmploye, NomEmploye, IdAppartL
From Employe E1, GererLocationAppart G1
Where E1.MatriculeEmploye=G1.MatriculeEmploye;
And
SELECT MatriculeEmploye, COUNT(IdAppartL)
FROM GererLocationAppart
GROUP BY MatriculeEmploye;
But i don't know how.. I try :
Select Distinct PrenomEmploye, NomEmploye
From Employe
Where MatriculeEmploye in
(SELECT MatriculeEmploye, COUNT(IdAppartL)
FROM GererLocationAppart
GROUP BY MatriculeEmploye);
But I get :
ERROR 1241 (21000): Operand should contain 1 column(s)