Skip to content
Advertisement

Tag: common-table-expression

Converting PostgreSQL to MySQL

I am following a tutorial on how to find recurring transactions in a bank statement dataset. I have all the data needed, but I have issues getting the queries to work with MySQL. Any idea on how to convert this to MySQL? The error is: Update I adjusted the SQL query based on feedback, and providing example data. Now I’m

SQL – An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause

If you see the picture below, I only want to see those categories where the average revenue is greater than the overall average. The query that I’m using is below. The very last line is causing the issue. The error that I’m getting is: An aggregate may not appear in the WHERE clause unless it is in a subquery contained

Advertisement