6
I have this query for Mysql:
SELECT email, COUNT(*) AS Vezes FROM automovel
GROUP BY email HAVING COUNT(*)
ORDER BY `data_cadastro` ASC
It groups all the same emails together, and shows how many times they appear. I need to make her just show how many times they repeat themselves, but without grouping the lines.
Has as?
https://fiddle.jshell.net/e70kz8fo/
Today she displays like this:
email Vezes em que aparece
pedro1@teste 1
pedro2@teste 3
I need to leave it like this:
email Vezes em que aparece
pedro2@teste 3
pedro1@teste 1
pedro2@teste 3
pedro2@teste 3
Is giving some error in line 7
check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT COUNT(* AS vezes, email FROM automovel GROUP BY email ) i ON i.email = ' at line 7
– Pedro Henrique Kuzminskas
@Pedrohenriquekuzminskas I broke the line to format, and ran over one of the parents. Now ok, I did. I actually had tested before posting, but I made a mistake while formatting.
– Bacco
@Pedrohenriquekuzminskas if you have any doubts about the operation, let me know that I try to explain better in the answer, it is good that you understand well, to be able to adapt in other situations.
– Bacco