October 25, 2024
Chicago 12, Melborne City, USA
SQL

Create new sequence in a table


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.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video