• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[Fwd: SQL query question]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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.

  • Prev by Date: Using raw rows with bind variables
  • Next by Date: Re: WO on OSX---help me transition
  • Previous by thread: Using raw rows with bind variables
  • Next by thread: Re: [Fwd: SQL query question]
  • Index(es):
    • Date
    • Thread