Notice: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',
sum(guest) guest ,
sum(guest + member) all_visitor ,
date(t' at line 3 Error No: 1064 INSERT INTO `oc_visitor_history` (`member`, `guest`, `all_visitor`, `date_history` )
SELECT
sum(member) member,
sum(guest) guest ,
sum(guest + member) all_visitor ,
date(time_check)
FROM (
SELECT
case when max(customer_id) = 0 then 1 else 0 end as guest ,
case when max(customer_id) > 0 then 1 else 0 end as member ,
ip as ip,
max(date(time_last)) as time_check
FROM oc_visitor a left join oc_visitor_history b on ( date(time_last) = b.date_history )
WHERE b.date_history is null
and date(time_last) <= date(CAST(NOW() - INTERVAL 1 DAY AS DATE))
and botname = 'no'
GROUP BY ip ,date(time_last)
) historical
GROUP BY date(time_check) in /home/xnccroha/domains/xn--c3croh4a3gjzb9qi3b.com/public_html/system/library/db/mysqli.php on line 41เปรียบเทียบสินค้า