I have this select:
select 'fv' prefix, c.user, MAX(f.data) as data, c.user, count(c.user) as logs
from favorites f inner join
cadastro c
ON f.user = c.id
where f.fv = '1' and c.user <> f.user and f.data > now()
If I have no result to show, mysql shows this:
prefix - user - data - user - logs
fv NULL NULL NULL 0
I don't want to show when there is no results. What is wrong? is the count(c.user)? how can I avoid count to count 0?