MySQL prior to version 8.0 doesn't support the WITH clause (CTE in SQL Server parlance; Subquery Factoring in Oracle), so you are left with using: TEMPORARY tables DERIVED tables inline views (effectively what the WITH clause represents - they are interchangeable) The request for the feature dates back to 2006. As mentioned, you provided a poor example - there's no need to perform a subselect ...
How can you connect to MySQL from the command line in a Mac? (i.e. show me the code) I'm doing a PHP/SQL tutorial, but it starts by assuming you're already in MySQL.
How to connect to MySQL from the command line - Stack Overflow
I am trying to figure out what the mysql -u root -p command does. I have googled the command but I can't find any good results.
How do you use the "WITH" clause in MySQL? - Stack Overflow
Also, MS allows for declares within any block in the procedure, unlike MySQL which requires all the DECLAREs at the top. While good on the command line, I feel using the set = @variable within stored procedures in MySQL is risky. There is no scope and variables live across scope boundaries.
How do I change the MySQL root password and username in ubuntu server? Do I need to stop the mysql service before setting any changes?
How to reset or change the MySQL root password? - Stack Overflow
You're trying to access the database from the localhost or from another host using MySQL Workbench?