Re: SQL - how to - I need a query solution, no coding....
Posted by --CELKO-- on 11/03/07 17:34
As an aside, if you want to be sure that each pin is in one and only
one bucket, then add an overlapping UNIQUE constraint.
CREATE TABLE Buckets
(bucket_name CHAR(1) NOT NULL
CHECK (bucket_name IN ('A','B','C','D','E','F','G')),
pin_nbr INTEGER NOT NULL UNIQUE
CHECK(pin_nbr BETWEEN 1 AND 1000),
PRIMARY KEY (bucket_name, pin_nbr));