Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Using recursive joins, subqueries and aliases on a single table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-25 : 18:16:05
Sean writes "I would like to create a query to simply list for each organisation, the employees belonging to it....simple enough right ?

The Address DB consist of two tables AdrCore.tbl and AdrRelation.tbl.

AdrCore.tbl has the following fields:

Adr_Name -- name of organisation or employee
Adr_Type -- employee=1, organisation = 2
Adr_Id -- unique id


AdrRelation.tbl has the following fields:

Adr_parent_id -- adress of organisation
Adr_Id -- address of employee

********************************
Result format:
Org1 org1employee1
org1 org1employee2
.
.
org1 org1employee n
org2 org2employee1
org2 org2employee2
.
.
org2 org2employee n"
   

- Advertisement -