If one query is a lookup query (authors) it can be safely cached - over time
this can be less overhead. Plus, if I understand what he is trying to do, he
would end up with an outer join and the longText field would be duplicated
in every row. That is not efficient by any means.  If you really want 1 call
to the db - put both queries in a stored proc and return 2 result sets : )

-----Original Message-----
From: Greg Morphis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 09, 2004 1:08 PM
To: CF-Talk
Subject: Re: When two tables go to war (JOIN)


I'm sorry I have to disagree...
I'd much rather make one call to the DB and get all of my results in 1
query. It's faster.



On Tue, 9 Nov 2004 19:59:14 +0100, Pascal Peters <[EMAIL PROTECTED]> wrote:
> Don't join them, there is no reason to in this case. Use 2 queries.
>
> Pascal
>
>
>
> > -----Original Message-----
> > From: Stuart Kidd [mailto:[EMAIL PROTECTED]
> > Sent: 09 November 2004 19:22
> > To: CF-Talk
> > Subject: When two tables go to war (JOIN)
> >
> > 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:183787
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