> SELECT cognome, count(1)
> FROM tbl_seba
> #where seba.cognome in ('bellu','mannu')
> where cognome = 'bellu' or cognome = 'mannu'
> group by 1
'COUNT(1)' and 'GROUP BY 1' make no sense. I tried this using mySQL 5.0.4-beta-nt-max and it worked without any errors. But the result doesn't really mean anything. These constructs are used properly with column names, not with values.
I think perhaps this is what you intended:
SELECT cognome, COUNT(cognome) AS num
FROM tbl_seba
WHERE cognome IN ('bellu', 'mannu')
GROUP BY cognome
This query returns
| cognome | num |
| bellu | 3 |
| mannu | 3 |
(Also, why the COMMIT statement? If you're using a MyISAM table, it's not necessary. In MyISAM, all data manipulation statements are committed as soon as they're executed.)
In future, please use this area of the forums for questions relating to the MySQL Manual or other MySQL documentation. Questions about using MySQL should go in the appropriate area. Thanks!
Jon Stephens
MySQL Documentation Team @ Oracle
MySQL Dev Zone
MySQL Server Documentation
Oracle