[Fwd: SQL query question]
[Fwd: SQL query question]
- Subject: [Fwd: SQL query question]
- From: "Janice M. Cheung" <email@hidden>
- Date: Mon, 10 Nov 2003 13:54:51 -0500
Greetings!
I have a question about sql queries.
Upon login, I would like my application to return all the affiliated
departments of a user.
This list of affiliated departments will be matched against the
user's Person Primary Key,
personPk, in the Person Table. The linking table between the
affiliated departments,
Affiliation, has the personFk and the departmentFk, and the
Department table has the
departmentPk.
I want to do something like this:
sql = new String ("select distinct Department_Name from
people_db.Department");
sql = sql + "where person.personPk = affiliation.personFk and
affiliation.departmentFk = department.departmentPk";
- if department Administrator:
- sql = sql + "where person.personPk = deptAdmin.personFk and
deptAdmin.deptFk = department.departmentPk";
but I'm having problems with the implementation... I've flattened
the attribute relationships already, but even though
I've set the person Primary Keys, the department lists are not
appearing.
If anyone can help me so that I can properly code this, I'd be
eternally grateful!!
Thanks very much!!
Janice
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.