Bonjour,

Petit soucis avec ma requete.
j'ai une table ou il y a genre, numLivre, etatLivre

je dois faire les stats par etatdeLivre,

style :

---------------------------------------------------------------------------
genre-----nblivres------etat1----etat2----etat3----------------------------
---------------------------------------------------------------------------
gaston ------15----------15
gaston -------2 -------------------2
gaston -------3 ---------------------------3
--------------------------------------------------------------------------
je voudrais regrouper le tout sur une ligne mais comment faire quand je groupe par genre ça me met style 15 etat 1 15...
voici ma requete (sans grouper)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
select 
	Genre,
	count(numLivre) as nbLivres,
	etat,
	case etat when 1 then count(numLivre) end as Etat1,
	case etat when 2 then count(numLivre) end as Etat2,
	case etat when 3 then count(numLivre) end as Etat3,
	case etat when 4 then count(numLivre) end as Etat4,
	case etat when 5 then count(numLivre) end as Etat5,
	case etat when 6 then count(numLivre) end as Etat6
 
	from livre
voila help please....