I have this table in my database:
╔════╦═══════╦═══════╗
║ id ║ Name ║ Price ║
╠════╬═══════╬═══════╣
║ 1 ║ ciao ║ 123 ║
║ 2 ║ ciao ║ 55 ║
║ 3 ║ bye ║ 43 ║
║ 4 ║ hello ║ 12 ║
║ 5 ║ ciao ║ 1 ║
║ 6 ║ ciao ║ 77 ║
╚════╩═══════╩═══════╝
..and i wound like to create a new view displaying two columns:
1) "ciao" or "not ciao"
2) how many rows in the previous table are "ciao" or "not ciao", something like this:
╔════╦══════════╦═══════╗
║ id ║ Name ║ Count ║
╠════╬══════════╬═══════╣
║ 1 ║ ciao ║ 4 ║
║ 2 ║ not ciao ║ 2 ║
╚════╩══════════╩═══════╝
I'm trying to find a solution, but i'm not able to group by "not ciao" values:
SELECT Name, COUNT(*)
FROM mytable
WHERE Name = "Ciao"
GROUP BY Name