On 12/26/05, John Wilker <[EMAIL PROTECTED]> wrote:
> (TypeIDFK = 1 AND Type IN (3,4)) (returns 6,12,15,16,17,77)
> (TypeIDFK = 2 AND Type IN (1,5)) (returns 2,3,5,6,9,12,15,20,22)
> (TypeIDFK = 3 AND Type IN (3,4)) (returns 6,33,66)
> (TypeIDFK = 4 AND Type IN (1,4)) (returns 2,4,6,14,19,20,23,27)
> (TypeIDFK = 5 AND Type IN (3,4)) (returns 3,6,7,8,10,12,33)

If there are just five TypeIDFK values, you could do this as five
consecutive queries. Would that be too horrible?

SELECT * FROM typelookup
WHERE (TypeIDFK = 1 AND Type IN (3,4))

SELECT * FROM typelookup
WHERE (TypeIDFK = 2 AND Type IN (1,5))
AND theKey IN (resultFromQuery1)

SELECT * FROM typelookup
WHERE (TypeIDFK = 3 AND Type IN (3,4))
AND theKey IN (resultFromQuery2)

SELECT * FROM typelookup
WHERE (TypeIDFK = 4 AND Type IN (1,4))
AND theKey IN (resultFromQuery3)

SELECT * FROM typelookup
WHERE (TypeIDFK = 5 AND Type IN (3,4))
AND theKey IN (resultFromQuery4)

You'd construct resultFromQueryX as a list from a column of the result
of query X.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227692
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to