I am trying to generate a row sequence number for a table.
I have tried the following two sqls, but get an error message about illegal alias on the update statement.
Does anyone have any ideas?
Thanks
Craig
CREATE SET TABLE dssbatch.tmp_test,
NO FALLBACK,
NO BEFORE JOURNAL,
NO AFTER JOURNAL
AS ( SELECT a.rowid as tmp_rowid, count(b.rowid) as tmp_count
FROM dssbatch.test b, dssbatch.test a
WHERE b.rowid <= a.rowid
GROUP BY a.rowid)
WITH DATA
update dssbatch.test a
from dssbatch.tmp_test b
set row_count = tmp_count
where b.tmp_rowid = a.rowid
I have tried the following two sqls, but get an error message about illegal alias on the update statement.
Does anyone have any ideas?
Thanks
Craig
CREATE SET TABLE dssbatch.tmp_test,
NO FALLBACK,
NO BEFORE JOURNAL,
NO AFTER JOURNAL
AS ( SELECT a.rowid as tmp_rowid, count(b.rowid) as tmp_count
FROM dssbatch.test b, dssbatch.test a
WHERE b.rowid <= a.rowid
GROUP BY a.rowid)
WITH DATA
update dssbatch.test a
from dssbatch.tmp_test b
set row_count = tmp_count
where b.tmp_rowid = a.rowid