I have an SQL db which contains a table of license plate numbers (plates), a table of parking lots (places), and a table corresponding one to the other over time (parking), each row placing a specific vehicle plate in a specific place at a particular time.
create table parking (
plateid integer,
placeid integer,
time_period integer
);
This means each row as a whole is unique but the plate/place combinations are not. I need to count how many times each plate appears in each place. There are an indeterminate number of both, so I cannot maintain a table per place and simply count the entries.
This is easy enough using a general purpose programming language applied to the list. Is there a way to do it with straight SQL?