Revision in query

0

I have this query in order to list users with more comments, however, it can not display users with the banned column = true.

SELECT * FROM usuarios a 
INNER JOIN topicos_comentarios b ON a.usuario = b.autor 
WHERE a.banido <> true 
GROUP BY a.usuario 
ORDER BY count(a.usuario) DESC LIMIT 3 

This select was made by a friend from here, but it is not working. Lists users normally including banned.

The structure of my users table:

    
asked by anonymous 05.07.2017 / 23:01

1 answer

1

Make sure this works:

SELECT * FROM usuarios a 
INNER JOIN topicos_comentarios b ON a.usuario = b.autor 
WHERE a.banido = 'false'
GROUP BY a.usuario 
ORDER BY count(a.usuario) DESC LIMIT 3 
    
05.07.2017 / 23:11