0
I’m making a Deploy on Heroku of a personal project developed in PHP in which it is almost finished, however, I am having this error with a query of my project that is not running on the server, but the same query in the localhost database it runs normally, I believe that Jawsdb mysql is a lower version that I was using, however, I do not know how I will replace this query for a version that is supported and it can deliver the same pattern as the previous one, I also tried to use clearDB but the same problem happens.
What I want to do is this. I want the query to be able to rescue the table value grouped by the day of the month, even if it has not spent that day, it returns the date and the value 0 as it is in the print. So I can put in the graph the user’s monthly expense data.
However, at Workbench he presents this information "WITH" is not valid at this position for this version of the server, expecting EOF,BEGIN, CACHE, CHECKSUM, COMMIT, DEALLOCATE. I honestly don’t know how to replace the query, I’m starting in web development. The mysql code I developed:
use `jk1zzmwwn6wtsy1v`;
WITH days AS(
SELECT DATE_ADD('2020-07-01',INTERVAL rnk DAY) day
FROM(SELECT row_number() over() -1 rnk
FROM information_schema.columns LIMIT 31)gerado)
SELECT
days.day,
IFNULL(sum(expenses.value), 0) as amount
FROM
days
LEFT JOIN tb_expenses as expenses ON expenses.date = days.day
AND expenses.id_wallet = 0
AND expenses.status = 1
WHERE days.day BETWEEN '2020-07-01' AND '2020-07-31'
GROUP BY days.day
ORDER BY days.day
Check existing DBMS versions on your machine and on the server where you want to install.
– anonimo
Version of jawsdb -> 5.7.23-log (Source Distribution) and is being compiled into linux. clearDB is 5.5.62. What is running on my machine and I used on my localhost was version 8.0.20 (Mysql Comminity Server - GPL)
– ClaudianoPL