1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Create new sequence in a table

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 25, 2024 às 16:02.

  1. Stack

    Stack Membro Participativo

    I need to create new sequence based on the SEQNO column below, I want the minimum SEQNO to always start with 1. How do I do that? I am not trying to alter the original table. I am just trying to add a new column to the data I pull so it is easier for me to join with other tables.

    Below are the examples from the table. The column "Order" is the column I want to create when I pull the data based on column SEQNO.

    ID SEQNO Order
    N1 4 1
    N1 7 2
    N1 11 3
    N2 3 1
    N2 5 2


    I didn't try anything because I don't know where to start.

    Continue reading...

Compartilhe esta Página