Re: Select from two tables not returning the expected number of rows

2004-10-13 Thread Philippe Poelvoorde
Ted Byrne wrote: you didn't say that (svr,started,ended,volume,who) is a unique key... If not, it would explain the result and the extra rows you get. Well... that combination of fields *should* be unique. Does a unique index need to be specified on those columns? It is possible that (svr,star

Re: Select from two tables not returning the expected number of rows

2004-10-13 Thread Ted Byrne
You didn't even say that (svr, started, ended, volume, who, action) was a unique combination of values for either table. If that is the case then you will have a hard time matching rows of one table uniquely to rows of the other table. Shawn, Sorry for the lack of clarity on my part. The combina

Re: Select from two tables not returning the expected number of rows

2004-10-13 Thread SGreen
Ted, You didn't even say that (svr, started, ended, volume, who, action) was a unique combination of values for either table. If that is the case then you will have a hard time matching rows of one table uniquely to rows of the other table. Try this query and you may be able to see where the

Re: Select from two tables not returning the expected number of rows

2004-10-13 Thread Ted Byrne
you didn't say that (svr,started,ended,volume,who) is a unique key... If not, it would explain the result and the extra rows you get. Well... that combination of fields *should* be unique. Does a unique index need to be specified on those columns? It is possible that (svr,started,ended,volume,

Re: Select from two tables not returning the expected number of rows

2004-10-13 Thread Philippe Poelvoorde
mysql>select count(*) from x.table_a,y.table_b WHERE x.table_a.svr = y.table_b.svr and x.table_a.started = y.table_b.started and x.table_a.ended = y.table_b.ended and x.table_a.volume = y.table_b.volume and x.table_a.who = y.table_b.who; you didn't say that (svr,started,ended,volume,who) is a uniq

Select from two tables not returning the expected number of rows

2004-10-12 Thread Ted Byrne
I'm struggling with this, and am not sure what I'm doing wrong... There are two tables in separate databases that have 6 fields in common. In addition to the six columns in common between table_a and table_b, each table has some additional fields that are not related. Table_a and table_b each