I am new to snowflake and I am trying to copy data from a view into an existing table
the below CTEs does some processes my data but when I try to copy the output view into a table I get Unexpected insert
with LD as(
select "ID",
"Value",
"Set",
ROW_NUMBER()OVER ( PARTITION BY "ID" order by "Set" desc ) as rownum
from "Archive"."Prty" l
where l."Prty" = 'Log' AND "ID"= 111
),
LD2 as (
select "ID",
"Value",
"Set",
ROWNUM
from LD where ROWNUM = 1
)
---- copy view into table -------
INSERT INTO "v1" ("ID", "Value","Set",ROWNUM )
SELECT * FROM LD2