Thank you everyone that responded, You were all correct. The query performed a cartesian product. I added a where statement and all was fine again.
Thanks! /Jonas ----- Original Message ----- From: "Victoria Reznichenko" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, May 24, 2004 12:16 PM Subject: Re: Select statement returning to many answers > Jonas Lind?n <[EMAIL PROTECTED]> wrote: > > Hello, I am running MySQL5.0.0 on my OpenBSD system. When I excute this > > query I get 153 hits. > > > > SELECT b.batch_id, b.date, b.creator, b.comments FROM cd_batch as b; > > > > But when I add this table to the where clause i get 5831 hits > > > > SELECT b.batch_id, b.date, b.creator, b.comments FROM cd_batch as b, > > cd_donor as d; > > > > Why does this happend? I thought that these two queries would return the > > exact same amout of rows. Is there something I have forgotten or is the > > debug release of 5.x.x errornous? > > > > You got in the result set cartesian product of cd_batch and cd_donor tables. > > > -- > For technical support contracts, goto https://order.mysql.com/?ref=ensita > This email is sponsored by Ensita.net http://www.ensita.net/ > __ ___ ___ ____ __ > / |/ /_ __/ __/ __ \/ / Victoria Reznichenko > / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] > /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net > <___/ www.mysql.com > > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]