Reputation:
SELECT count(*), idstagiaire
FROM absence
natural join stagiaire
where idfliere=2 AND typeabcense='nojustifie'
AND GROUP By idstagiaire;
I get error:
Missing expression
stagiaire(idstagiaire,nom,prenom,idfliere,totalabsence)
Filiere(idfliere,nomfiliere)
module(idmodule,nommodule,nbrmodule)
fil_module(idfliere,idmodule)
absence(idabsence,dateabence,idstagiaire,idmodule,typeabcense)
Upvotes: 1
Views: 133
Reputation: 9439
Try without the last AND.
SELECT count(*), idstagiaire
FROM absence
natural join stagiaire
where idfliere=2 AND typeabcense='nojustifie'
GROUP By idstagiaire;
Upvotes: 0
Reputation: 2200
Try this
SELECT count(*),idstagiaire FROM absence natural join stagiaire where
idfliere=2 AND typeabcense='nojustifie'
GROUP By idstagiaire;
Upvotes: 1
Reputation: 8839
in below code
AND GROUP By idstagiaire;
AND is error, remove AND before of group by, if you want to add another condition then add it after AND, for example
AND 'YOUR NEW CONDIOTION HERE' GROUP By idstagiaire;
Upvotes: 0
Reputation: 1943
Remove 2nd 'AND' from query
SELECT count(*), idstagiaire
FROM absence
natural join stagiaire
where idfliere=2 AND typeabcense='nojustifie'
GROUP By idstagiaire;
Upvotes: 1
Reputation: 2379
SELECT count(*),idstagiaire
FROM absence natural join stagiaire where idfliere=2 ANDtypeabcense='nojustifie'
AND-------------------------------> Remove this AND
GROUP By idstagiaire;
Upvotes: 1
Reputation: 69440
remove the last and
:
SELECT count(*),idstagiaire
FROM absence natural join stagiaire
where idfliere=2 AND typeabcense='nojustifie'
GROUP By idstagiaire;
Upvotes: 1