I have this query from PHP , which does not return values but if I execute it from Oracle SQL Developer it shows me data.
$sucursalesaño=[];
$ventasaño=[];
$query ='SELECT S.SUCURSAL , SUM(V.TOTAL_VENTAS)
FROM T_VENTAS V, T_SUCURSAL S, T_TIEMPO T
WHERE V.ID_TIEMPO= T.ID_TIEMPO AND T.AÑO=2016
AND S.ID_SUCURSAL =V.ID_SUCURSAL AND V.ID_SUCURSAL IN (1,2,3,4,5,6)
GROUP BY SUCURSAL';
$stid = oci_parse($conn, $query);
oci_execute($stid);
while (($row = oci_fetch_array($stid, OCI_BOTH)) != false)
{
array_push($sucursalesaño, $row[0]);
array_push($ventasaño, $row[1]);
}
oci_free_statement($stid);
Without changing the time to make a query from a single table like the following if you show me information:
SELECT COLONIA,SUM(PRECIOFINAL) PFINAL from TDATOS where LOCATION_CODE=11174 and COLONIA IS NOT NULL GROUP BY COLONIA;
The only difference with the function is the query, they could help me