This topic is locked

SQL request

4/18/2017 11:07:41 AM
PHPRunner General questions
H
htmalbenur author

Here are the two SQL query I want the merged to give me a single query showing me the result on the picture 5
1)
SELECT

fn_nord.Sexe AS Sexe,

fn_nord.Age,

COUNT(fn_nord1.Age) AS Quantité

FROM fn_nord

INNER JOIN fn_nord AS fn_nord1 ON fn_nord.Dossier = fn_nord1.Dossier

WHERE (fn_nord.Sexe ='Masculin')

GROUP BY fn_nord.Sexe, fn_nord.Age
2)
SELECT

fn_nord.Sexe AS Sexe,

fn_nord.Age,

COUNT(fn_nord1.Age) AS Quantité

FROM fn_nord

INNER JOIN fn_nord AS fn_nord1 ON fn_nord.Dossier = fn_nord1.Dossier

WHERE (fn_nord.Sexe ='Féminin')

GROUP BY fn_nord.Sexe, fn_nord.Age
http://imgur.com/8gymdL5

http://imgur.com/kH2ojlD

http://imgur.com/c2Ok1S8
thx a lot.

W
WilliamBDevClub member 4/18/2017

Maybe you want this?



SELECT

fn_nord.Sexe AS Sexe,

fn_nord.Age,

COUNT(fn_nord1.Age) AS `Quantité`

FROM fn_nord

INNER JOIN fn_nord AS fn_nord1 ON fn_nord.Dossier = fn_nord1.Dossier

GROUP BY fn_nord.Sexe, fn_nord.Age
H
htmalbenur author 4/18/2017

I would like to merge the two queries to have a single table that can give me the result in the photo 5