Prerequisito: MySql 5.x
Supponendo che sia (per esemplificare)
Tabella Utenti:
ID,
nome,
ecc...
Tabella UtentiBannati
ID (corrisponde a ID di Utenti)
...
la query:
Speriamo che sia giusto!codice:SELECT nome, COUNT(ID) as num FROM `Utenti` where `ID` NOT IN (SELECT `ID` from `UtentiBannati`) GROUP BY nome ORDER BY num DESC LIMIT 0,15
HTH
Zappa

Rispondi quotando