Hi All,
I have a Geographic parent/child relationship table with the following
columns.
Geographic_Units
-------------------
Geo_Unit_Code (PK)
Geo_Unit_Name
Geo_Unit_Type
Parent_Geo_Unit_Code
And Sample Data is as follows.
Geo_Unit_Code Geo_Unit_Name Geo_Unit_Type Parent_Geo_Unit_Code
------------- ------------------------- ----------------
----------------
WRLD WHOLE WORLD WORLD (null)
NA NORTH AMERICA CONTINENT WRLD
EU EUROPE CONTINENT WRLD
USA UNITED STATES OF AMERICA COUNTRY NA
CAN CANADA COUNTRY NA
SPN SPAIN COUNTRY EU
FNL FINLAND COUNTRY EU
AZ ARIZONA STATE USA
OH OHIO STATE USA
In a hierarchical form, it is as follows:
WORLD
NORTH AMERICA
UNITED STATES OF AMERICA
ARIZONA
OHIO
CANADA
EUROPE
SPAIN
FINLAND
There is an employee table having a Geo_Unit_Code column referencing
to the Geo_Unit_Code of the Geographic_Units. Now I have to write a
query which will give me employee information for each continent.
So my final result set should contain the continent name and employee
id(the PK in the Employee table).
Can any one help pls?? I am newbie in oracle. Figuring out how to use
the "Connect by" clause for this query.
TIA,
~Anand