Subject sql query in firebird
Author Olaf Kluge
Hello,



fb 2.1 cs is running



Now I have four tables:



Persons:

ID

Name

EMAIL



ORDER:

ProjectID

PERSON_WHO_GET (references ID from Persons)

STATUS



Projects:

ProjectID

Manager (references ID from Persons)



ProjectSEND:

ProjectID

PERSON_WHO_GET_INFO (references ID from Persons)



Each Person (ID) is unique, each ProjectID too. Every order has one
person_who_get, one Project has 1:n orders. In ProjectSend can I configure
many persons who get an email for one Project.



Starting with the order table and its status (open), I can reference to the
project, than to the projectSend-Table. I would get all Persons (ID)
grouped, which are deposited with the order, the project (in dependence on
procect) and who is configurated to became an email (ProjectSend)



For example:



Order 123

Person who get Order: 2

For Projekct ABC



ProjectManager for ABC: 23



ProjectSend f

Project: ABC, Person_who_get_info: 32

Project: ABC, Person_who_get_info: 33



Now I would get some results:

Person 2

Person 23

Person 32

Person 33



It is possible without a stored procedure?



Thanks in advance.



Best regards



Olaf







[Non-text portions of this message have been removed]