Help Please! - Mailing list pgsql-general

From Arthur M. Kang
Subject Help Please!
Date
Msg-id 387CFDA0.920CFE7C@levelogic.com
Whole thread Raw
List pgsql-general
I'm trying to create a table which has two keys, but on of the keys auto-increments depending on the second key.

key1  | key2
------------
1     | NJ
2     | NJ
1     | CA
2     | CA
3     | CA
4     | CA

Now, with a single insert statement, I would like the next entry to be (3,'NJ'); the 3 being the next incremented value corresponding with 'NJ.
Can anyone point me in the right direction or give me any clues?

I would be MOST appreciative.  TIA.

Arthur

pgsql-general by date:

Previous
From: "Arthur M. Kang"
Date:
Subject: Stumped. Somebody Help me please!
Next
From: admin
Date:
Subject: rule or trigger on select?