I have the following statement:
CREATE TABLE result2 AS
SELECT t.*
FROM sample1 as t
CROSS JOIN (select * from range(0,10)) v(i);
select * from result2;
and I'd like to have in the created table (result2), which contains the column 'id' from sample1
, that the corresponding 'id' column has instead the row number. I'd prefer to have this OTF rather than create a new table, then manipulate this new table using say UPDATE
and SET
. How can I achieve this?