user4778170
user4778170

Reputation:

Missing Expression

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

Answers (6)

itzmebibin
itzmebibin

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

SimarjeetSingh Panghlia
SimarjeetSingh Panghlia

Reputation: 2200

Try this

SELECT  count(*),idstagiaire  FROM absence natural join stagiaire  where 
idfliere=2 AND typeabcense='nojustifie'
GROUP By idstagiaire; 

Upvotes: 1

I A Khan
I A Khan

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

Pradnya Bolli
Pradnya Bolli

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

Dhaval
Dhaval

Reputation: 2379

 SELECT  count(*),idstagiaire 
 FROM  absence  natural join stagiaire  where idfliere=2 ANDtypeabcense='nojustifie'
 AND------------------------------->  Remove this AND   
 GROUP By idstagiaire; 

Upvotes: 1

Jens
Jens

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

Related Questions