Hi to all,
I am trying to find out a way to extract rows with a maximal value of the certain attribute in a group.
For example the task is for a set of provinces which in turn are divided into a number of administrative units to list for each province only the administrative unit with the highest population. How can I do this?
CREATE TABLE Admin_Unit
Population int NOT NULL,
Area int NOT NULL,
PRIMARY KEY (Ad_Id),
FOREIGN KEY (P_Id) REFERENCES Province(P_Id)
Each province is composed of the administrative units described by the population, area, ruling party, legislation type etc.
I am trying to find a way to select for each province an administrative unit with the largest population in a group of adminstarative units with the same ruling_part, legislation and area larger than certain limit value.
How to do this?