Re: nuts & bolts query ?

2005-05-17 Thread Jeff Langevin
?? > > -Original Message- > From: Jeff Langevin [mailto:[EMAIL PROTECTED] > Sent: Monday, May 16, 2005 4:59 PM > To: CF-Talk > Subject: Re: nuts & bolts query ? > > Connect query analyzer to the appropriate database server. Select the > appropriate table f

RE: nuts & bolts query ?

2005-05-16 Thread Tim Laureska
he "bottom (inner) input" ?? I would assume outer means the "members m" table and inner means "members_categories d" table ?? -Original Message- From: Jeff Langevin [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 4:59 PM To: CF-Talk Subject: Re: nuts &

Re: nuts & bolts query ?

2005-05-16 Thread Jeff Langevin
the CF tags, but got a bunch of errors... what's the best way to > utilize the query analyzer for a baic query like this? > > -Original Message- > From: Jeff Langevin [mailto:[EMAIL PROTECTED] > Sent: Monday, May 16, 2005 4:39 PM > To: CF-Talk > Subject: Re: nuts &

RE: nuts & bolts query ?

2005-05-16 Thread Tim Laureska
I figured it out... thanks Jeff for the tip -Original Message- From: Jeff Langevin [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 4:39 PM To: CF-Talk Subject: Re: nuts & bolts query ? The first query creates an inner join between the two tables. Try dumping them into q

RE: nuts & bolts query ?

2005-05-16 Thread Tim Laureska
riginal Message- From: Jeff Langevin [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 4:39 PM To: CF-Talk Subject: Re: nuts & bolts query ? The first query creates an inner join between the two tables. Try dumping them into query analyzer and take a look at the execution plan. It&#

Re: nuts & bolts query ?

2005-05-16 Thread Jeff Langevin
The first query creates an inner join between the two tables. Try dumping them into query analyzer and take a look at the execution plan. It'll give you a better idea of what its doing with your queries. --Jeff On 5/16/2005 3:45 PM, Tim Laureska wrote: > I must be losing itWhy do these

RE: nuts & bolts query ?

2005-05-16 Thread Tim Laureska
[mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 4:14 PM To: CF-Talk Subject: Re: nuts & bolts query ? Yep, your logic is off. If you want to collapse that data, just do a distinct clause. But, you're then asking your database to do more work than necessary. If you just want the compan

Re: nuts & bolts query ?

2005-05-16 Thread Deanna Schneider
Joe Rinehart [mailto:[EMAIL PROTECTED] > Sent: Monday, May 16, 2005 3:36 PM > To: CF-Talk > Subject: Re: nuts & bolts query ? > > Tim, > > You're getting four records because member_id 13 is associated with > four member_categories. What is the result you're t

RE: nuts & bolts query ?

2005-05-16 Thread Tim Laureska
-Talk Subject: Re: nuts & bolts query ? Tim, You're getting four records because member_id 13 is associated with four member_categories. What is the result you're trying to get? -Joe On 5/16/05, Tim Laureska <[EMAIL PROTECTED]> wrote: > I must be losing itWhy do t

RE: nuts & bolts query ?

2005-05-16 Thread Tim Laureska
The query you offered below also pulls 4 records -Original Message- From: Justin D. Scott [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 3:36 PM To: CF-Talk Subject: RE: nuts & bolts query ? > I must be losing it... Your first query is returning four rows because there are

RE: nuts & bolts query ?

2005-05-16 Thread Justin D. Scott
> SELECT m.company > FROM members m LEFT JOIN member_categories d > ON m.member_id = d.member_id > WHERE m.member_id = #session.member_id# I think you may also need a GROUP BY... SELECT m.company FROM members m LEFT JOIN member_categories d ON m.member_id = d.member_id WHERE m.member_id = #sessio

RE: nuts & bolts query ?

2005-05-16 Thread Justin D. Scott
> I must be losing it... Your first query is returning four rows because there are four matching results from the member_categories table, so it is returning m.company for each one of those. If you only want it to return one record from members no matter how many are in member_categories, you nee

Re: nuts & bolts query ?

2005-05-16 Thread Joe Rinehart
Tim, You're getting four records because member_id 13 is associated with four member_categories. What is the result you're trying to get? -Joe On 5/16/05, Tim Laureska <[EMAIL PROTECTED]> wrote: > I must be losing itWhy do these two queries return different sets of > results when we're only