Updating a field by the order of onother...
Hi!
I have the following table
Table name "control"
ID:identity
ID_MEMBER:integer
ORDER_NUM:integer
I need to update the whole table. Seetting the field ORDER_NUM to the position of the order by ID_MEMBER....it is dificult to explain....
so here goes an example
let say that I have the following values
ID ID_MEMBER ORDER_NUM
----------------------------------------
1 1 ?
2 5 ?
3 2 ?
I need to update the table to:
ID ID_MEMBER ORDER_NUM
----------------------------------------
1 1 1
2 5 3
3 2 2
It should be simple but I do not know how.....
set @t=1;
update control set @t=@t+1,ORDER_NUM=@t
of course this does not work......
As you probably guess this table is used to control the memberships orders of another table that has all the deltails of the member....The spanish law obliges you to keep a numeric order without gaps.
I need call this update every time someone adds a member or disables it membership or activates its.
Subject
Written By
Posted
Updating a field by the order of onother...
May 27, 2005 03:22AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.