Hi. I have the following test db/tbl setup.
stateTBL +--------------+ | stateName | | stateID |>>>>>>>+ +--------------+ V V V collegeTBL V +--------------+ V | collegeName | V | stateID |<<<<<<<+ | collegeID |>>>>>>>+ +--------------+ V V V deptTBL V +--------------+ V | deptName | V | collegeID |<<<<<<<+ | deptID |>>>>>>>+ +--------------+ V V V courseTBL V +--------------+ V | courseName | V | deptID |<<<<<<<+ | courseID |>>>>>>>+ +--------------+ V V V facultyTBL V +--------------+ V | facultyName | V | courseID |<<<<<<<+ | ID | +--------------+ userTBL +--------------+ | userName | | itemID | | itemType | | assignedDate | | userID | +--------------+ --------------------------------- itemTBL +--------------+ | type | | itemID | +--------------+ itemTBL denotes a College, Dept, Course, Faculty (could just as easily have had the separate cols in the userTBL, for each of the items.. this would have resulted in empty fields, as the app would have had a single item per row in the userTBL..) type itemID college 1 dept 2 course 3 faculty 4 ---------------------------------- the userTBL is used to track each item the user is responsible for. an item could be a College, Dept, Course, or Faculty. my intended app will allow the user to select a given item (college, dept, course, faculty) and to store this data. when a user is displaying a list of items, i'd like to have my app determine if the child of the item has been selected by the user. so. if a user has selected stanford, i'd like to be able to have a query that returns 'true' for any item, that has a 'child' (leaf) already selected by the user. (this should work for any level of childTBL) so if a user has selected a course, from the stanford, physics dept, physics 101, i'd like to have a query that returns 'true' if the user selects 'stanford' from the list of colleges... i'm hoping that this makes sense!! thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]