To create unique id for a group [message #291302] |
Thu, 03 January 2008 14:15  |
bella13
Messages: 90 Registered: July 2005
|
Member |
|
|
CREATE TABLE A
(
ACCT_ID NUMBER,
ACCT_NUM VARCHAR2(20 BYTE)
)
The data is
acct id acct_num
==========================
ACCT1
ACCT1
ACCT1
ACCT1
ACCT2
ACCT2
ACCT3
I have a sequence which should populate a number that is unique for the acct_num
so basically i want the data to look like this-
acct id acct_num
==========================
1 ACCT1
1 ACCT1
1 ACCT1
1 ACCT1
2 ACCT2
2 ACCT2
3 ACCT3
Not sure how to achieve this? ANy thoughts and clues. I will have to do this in an insert statement.
I can also set null acct id at insert and then do it at update. But not sure how to
to set unique acct id for the acct_num?
Thanks for your time
|
|
|
|
|
|