this sql I tested it work
SELECT
public.pong8_maintable.stockid,
date_trunc('hour', public.pong8_maintable."timestamp8") as Date_hour,
public.pong8_maintable."Turnover"
FROM
public.pong8_maintable
This line does not work when I delete this line date_trunc("'"hour"'", public.pong8_maintable."timestamp8") as Date_hour, code will work
$sql =' CREATE TABLE pong8_StepOneSection as
SELECT
public.pong8_maintable.stockid,
public.pong8_maintable.filname,
date_trunc("'"hour"'", public.pong8_maintable."timestamp8") as Date_hour,
public.pong8_maintable."Turnover"
FROM
Public.pong8_maintable ' ;
sc_exec_sql($sql);
How can I fix it please suggest