Excellent reply, thanks Tore. I think I have got a Cartesian product, but I dont know what to do about it!
Also, I get this error when trying to use GROUP BY without using an aggregate function: Column 'tblJob.JobRef' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause ...so I went and included every single column from all the tables which I have inner joinned, but I exceeded the maximum allowed in the GROUP BY clause. What I am doing wrong here? Thanks, Sam ----- Original Message ----- From: "Bostrup, Tore" <[EMAIL PROTECTED]> To: "ActiveServerPages" <[EMAIL PROTECTED]> Sent: Friday, September 27, 2002 2:29 PM Subject: RE: GROUP BY question > Beware your question... > > GROUP BY without any aggregate functions works like a DISTINCT. If you get > multiple copies of the same data, make sure that is not a result of a > Cartesian product in the underlying query. In this case, although you will > get fewer rows back (it eliminates the duplicate rows), your query is just > as inefficient - except for the network traffic generated by your returned > data. > > HTH, > Tore. > > -----Original Message----- > From: Sam Thompson [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 27, 2002 4:12 AM > To: ActiveServerPages > Subject: GROUP BY question > > > Will using GROUP BY help me cut down the amount of records that are > returned? Or does it just organise them? > > Can I use it without using an aggregate function? > > Thanks, Sam > > > --- > You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] > To unsubscribe send a blank email to > %%email.unsub%% > > --- > You are currently subscribed to activeserverpages as: [EMAIL PROTECTED] > To unsubscribe send a blank email to %%email.unsub%% > --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
