This should work:

SELECT f.FeatureName
FROM tbl_020articleFeatures f
INNER JOIN YourJoiningTable j ON ( f.FeatureID = j.FeatureID )
INNER JOIN tbl_020authorDetails a ON ( j.AuthorID = a.AuthorID )
WHERE a.AuthorID = #CLIENT.authorID#

Ade

-----Original Message-----
From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED]
Sent: 25 September 2005 16:07
To: CF-Talk
Subject: Damn Queries!


Hi,

I have a table named tbl_020articleFeatures which has fields  
featureID and featureName.

I also have  a table named tbl_020authorDetails which has authorID as  
a field (as well as other stuff).

I made a 'cross table' which is called tbl_020authorFeatures - this  
table will have rows to establish which authors are authorised to  
write which particular features.  In here the fields I have are  
authorFeatureID, featureID and authorID.

I am trying to write a query which will pull only the features which  
e particular author can write.

At the moment I have it in 2 queries but i wouldn't be surprised if i  
could just have one:

         <!--- find all feature that this author is authorised to  
write about --->
         <cfquery name="GetAuthorFeatures" datasource="user020">
         SELECT authorFeaturesID, featureID, authorID
         FROM tbl_020authorFeatures
         WHERE authorID = #client.authorID#
         </cfquery>

         <!--- find all feature types --->
         <cfquery name="GetArticleFeatureTypes" datasource="user020">
         SELECT featureID, featureName
         FROM tbl_020articleFeatures
         WHERE featureID = '#GetAuthorFeatures.featureID#'
         ORDER by featureName ASC
         </cfquery>

And at the moment this is only pulling the first feature ID.

If anyone could be of any help i would be grateful.

Thanks,

Saturday

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219189
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