I have run into a problem where when I try to run all queries it only shows the first 78 queries (it still runs the rest of the queries but runs them on the same line as if it was just one big query) but when I get the results it just gives me the amount of time that it took for the first 78. If I run the rest of the queries after the problem it shows the following 180+ queries without a problem. I have tried multiple things to try and resolve the problem but not sure what I am missing.
PROBLEM QUERY :
CREATE TABLE if NOT EXISTS
SELECT P.HNPI, P.NPI,
SUM( Case when P.CPT="G0438" then P.CPTCount END ) AS 'G0402Total',
SUM( Case when P.CPT="G0439" then P.CPTCount END ) AS 'G0438Total',
SUM( Case when P.CPT="G0402" then P.CPTCount END) AS 'G0439Total'
FROM awvcount P
GROUP BY P.NPI
PS. running a few procedures before this query. and updates to said query after.