I have a table "clients" that contains the data of clients and another "friends" that contains the data of friends invited by a client. I want by means of a Select to obtain the mail of the clients who have invited a multiplo of 5 friends.
I have something like that, but it does not work for me
SELECT id_clientes, email
FROM clientes WHERE (SELECT COUNT(*) FROM amigos WHERE id_clientes = id_clientes) % 5 = 0;
Could someone help me? Thanks in advance