db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caron, Roger A." <roger.ca...@pw.utc.com>
Subject Criteria: Multiple Instances of same table
Date Tue, 18 May 2004 19:08:59 GMT
I'm trying to run a query which compares IDs in two tables against the IDs
of a third, based on criteria set on the third.  The problem is that the two
tables I want to return have to use different data sets from the third since
they're not identical.

Here's my actual situation:
Table 1: PERMISSIONS
Table 2: OBJECT1
Table 3: OBJECT2

My permissions works similar to a tree, where if you have access to OBJECT1,
you may have access to OBJECT2, but just because you have permission to
OBJECT2 doesn't guarantee you access since you may not be able to access
OBJECT1.

So what I'm looking for is something to get the following sql:

select OBJECT2.objectName from OBJECT2, OBJECT1, PERMISSIONS A, PERMISSIONS
B where OBJECT2.permissionId=A.permissionId and
OBJECT1.permissionId=B.permissionId and A.usersWithAccess="roger" and
B.usersWithAccess="roger"

This way I can test if "roger" has access to OBJECT2 and OBJECT1 and
therefore display OBJECT2.

Any suggestions on how to get multiple instances of the PERMISSIONS table?

Thanks

Roger 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message