Re: SQL - how to - I need a query solution, no coding....
Posted by --CELKO-- on 11/02/07 16:26
>> What would be the simplest way to achieve that, please ? <<
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
CHECK(pin_nbr BETWEEN 1 AND 1000),
PRIMARY KEY (bucket_name, pin_nbr));
SELECT pin_nbr, COUNT(*) AS bucket_cnt
FROM Buckets
GROUP BY pin_nbr;