Since the SQL statement is an INSERT statement, you need to have the common table expression definitions declared with the nested SELECT statement. Here's a simple example:
INSERT INTO out_table
WITH my_cte (m1,m2) AS (SELECT absval(col1), absval(col2) FROM my_table )
SELECT m1, m2 FROM my_cte;
|