79503105

Date: 2025-03-12 09:19:45
Score: 0.5
Natty:
Report link

For those that have landed here while trying to solve the same problem for MySQL, the INSERT statement has to go before the CTE:

-- MySQL code! Not SQL Server
INSERT INTO tablea(a,b)
WITH alias AS
(
    SELECT y,z FROM tableb
)
SELECT y, z 
FROM alias
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Steven Cromb