
Membre
|
Bonjour,
Bonjour,
Je bloque sur cette requête:
select c.id, c.name, c.description, c.position, (select count(t.id)
from topics
as t where
t.parent=c.id
and t.id2=1)
and as topics,
(select count(t2.id)
from topics as t2
where t2.parent=c.id
and t2.id2!=1)
as replies
from categories
as c group by c.id order by c.position asc
J'aimerai extraire que le numéro 1 dans la base en se basant sur l'id.
Pour cela j'ai pense à ca:
select c.id, c.name, c.description, c.position, (select count(t.id) from topics as t where t.parent=c.id and t.id2=1)and c.id=1as topics, (select count(t2.id) from topics as t2 where t2.parent=c.id and t2.id2!=1) as replies from categories as c group by c.id order by c.position asc
Mais ça ne marche pas. Savez vous pourquoi?
merci d'avance de votre aide.
Bien cordialement.
|