<cfquery name="showArticle" datasource="user020">
SELECT a.*, b.authorID, b.authorFirstName, b.authorSurname
FROM Articles a, Authors b
WHERE a.authorID = b.authorID
AND a.articleID = '#url.updateID#
</cfquery>


On Tue, 09 Nov 2004 18:22:27 +0000, Stuart Kidd <[EMAIL PROTECTED]> wrote:
> Hi guys,
> 
> I've got two tables:
> 
> 1 is full of articles (articleID, articleName, articleBody, authorID)
> 2 is full of authors (authorID, authorFirstName, authorSurname)
> 
> I would like to join them.
> 
> <cfquery name="showArticle" datasource="user020">
> SELECT *
> FROM Articles
> WHERE articleID = '#url.updateID#
> </cfquery>
> 
> And
> 
> <cfquery name="getAuthor" datasource="user020">
> SELECT authorID, authorFirstName, authorSurname
> FROM Authors
> </cfquery>
> 
> Could somebody please explain how to join them so I only retrieve certain
> articles (where articleID = #url.updateID#) but get all the Authors (as I
> want to populate a list whereby the user can select who is the author of
> this particular article).
> 
> Thanks very much guys,
> 
> Saturday
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183774
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to