Could someone help me to compose select statement for the following logic?
I have to load the table from DW staging to my database. The original table does not have primary key, and it has detail records for other, control table (as foreign key). Basically, for one ID it has multiple records.
I would like to number the records within ID group (will be a new column in SQL statement - DETAIL_RECORD_NUMBER).