I have a problem. I create my view:
SELECT
imp.societa_id,
status,
dominio,
online as data_online,
dataora as data_iscrizione,
online_dominio as data_online_dominio,
COUNT(DISTINCT cookieId) as visitatori_unici,
COUNT(cookieId) as pagine_viste
FROM gioca_sitelli.sitello as sit, gioca_report.2009_01_impression_sito as imp
WHERE sit.id = imp.societa_id AND imp.stato = "PASS"
GROUP BY imp.societa_id
I allow adv search but if i try to set a value i have this error:
Invalid use of group function
Query SQL:
SELECT DISTINCT COUNT(cookieId) FROM gioca_sitelli.sitello as sit, gioca_report.2009_01_impression_sito as imp WHERE (sit.id = imp.societa_id AND imp.stato = "PASS" ) and ( COUNT(cookieId) like '%76%')GROUP BY imp.societa_id ORDER BY 1 LIMIT 10
The error is ( COUNT(cookieId) like '%76%')GROUP BY imp.societa_id because is in where because there is a group by. How can change the preimposte code for set this in having?
thanks a lot.