As a title I have a table named: campagne_cliente
CREATE TABLE `campagne_cliente` (
`id_campagna_cliente` int(11) NOT NULL,
`cliente_id_campagna` int(11) NOT NULL,
`impianto_id_campagna` int(11) NOT NULL,
`nome_campagna_cliente` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Where impianto_id_campagna is the id of the products contained in another table.
I need the query to count the parameter number (impianto_id_campagna)from the table campagne_cliente, when it is null.
vulgarly told how many times the parameter impianto_id_campagna was not put, for all id_campagna_cliente
Practice:
`id_campagna_cliente` = 5
`cliente_id_campagna` = 12
`impianto_id_campagna` =
`nome_campagna_cliente` = facoltative name
my try:
select count('impianto_id_campagna')
FROM campagne_cliente
HAVING COUNT(impianto_id_campagna) > 1
GROUP BY campagne_cliente.id_campagna_cliente;