I am stuck on SQL I need to write (and I'm a SQL novice).
I have a table that contains data with a structure like this:
Table: CURRENT_TABLE
You can use row_number():
row_number()
select item_id, row_number() over (partition by item_id order by (select null)) - 1 as seq, col1, col2, other_col from t;
You can use into to put the results in a new table.
into
1.4m articles
1.4m replys
5 comments
57.0k users