All pastes #438297 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-13 15:19 UTC
rendered paste body
I have two tables.  

Dept
-----
deptid bigint PK
Name

Item
----
deptid bigint PK (FK)
itemid bigint PK
description

Here is an example of 2 valid records:
Dept: 1
Item: 1
Name: hammer

Dept: 2
item: 1
Name: Chainsaw


Is there a way to create sub sequence from the department sequence so these keys can be auto generated?