2
Good afternoon everyone, I have the following table:
I have the following select:
"SELECT DISTINCT `ip` FROM `visualizacoes` WHERE MONTH(data) = MONTH(NOW()) AND id_usuario = :id_usuario"
Use the distinct to returns only one record per ip, but would like to return an ip record per news.
EX: if a particular ip views the post 1, and then views the post 2 I want to return the two record.
But if it views the post 1 twice I want it to return only one record
PS: Ignore the existence of two columns on date.
Of the one
group by ip, id_noticia
see if it is the desired result, and take the distinct.– rray
That’s exactly what I needed!
– Helmesvs