M
Mike Thomas
Is there an SQL statement which would populate the 'ItemNo' column below;
incrementing the ItemNo column by 1 for each row involved? I can do it
procedurally, and I suppose I could use a function with a static variable -
is there anything a little more graceful?
UPDATE TableX SET ItemNo = ???? Where FKey = 3 Order By Name
Before:
PrimeKey FKey Name ItemNo
4 3 Al null
3 3 Bob null
1 3 Carl null
6 3 Don null
After:
PrimeKey FKey Name ItemNo
4 3 Al 1
3 3 Bob 2
1 3 Carl 3
6 3 Don 4
Many thanks,
Mike Thomas
incrementing the ItemNo column by 1 for each row involved? I can do it
procedurally, and I suppose I could use a function with a static variable -
is there anything a little more graceful?
UPDATE TableX SET ItemNo = ???? Where FKey = 3 Order By Name
Before:
PrimeKey FKey Name ItemNo
4 3 Al null
3 3 Bob null
1 3 Carl null
6 3 Don null
After:
PrimeKey FKey Name ItemNo
4 3 Al 1
3 3 Bob 2
1 3 Carl 3
6 3 Don 4
Many thanks,
Mike Thomas