Re: WHERE vs. ON

2009-02-04 Thread Baron Schwartz
On Tue, Feb 3, 2009 at 12:24 PM, Jerry Schwartz jschwa...@the-infoshop.com wrote: Somebody, I think it was somebody from MySQL, said that you should never put anything into a WHERE clause that could be put into the ON clause of a JOIN. My guess is that this helps with the optimization, but it

RE: WHERE vs. ON

2009-02-04 Thread Jerry Schwartz
-Original Message- From: baron.schwa...@gmail.com [mailto:baron.schwa...@gmail.com] On Behalf Of Baron Schwartz Sent: Wednesday, February 04, 2009 10:03 AM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: WHERE vs. ON On Tue, Feb 3, 2009 at 12:24 PM, Jerry Schwartz jschwa

Re: WHERE vs. ON

2009-02-04 Thread John Daisley
Never tried it in MySQL and Im not in a position to do so at the moment but in Oracle you can do a left outer join in the where clause something like this SELECT t1.col1, t2.col2 FROM table1 t1, table2 t2 WHERE t1.join_col_name = t2.join_col_name(+) Does this not work in MySQL? Never tried it

RE: WHERE vs. ON

2009-02-04 Thread Jerry Schwartz
-Original Message- From: John Daisley [mailto:john.dais...@mypostoffice.co.uk] Sent: Wednesday, February 04, 2009 10:41 AM To: mysql@lists.mysql.com Cc: Jerry Schwartz Subject: Re: WHERE vs. ON Never tried it in MySQL and Im not in a position to do so at the moment but in Oracle you can

Re: WHERE vs. ON

2009-02-04 Thread Martijn Tonies
Never tried it in MySQL and Im not in a position to do so at the moment but in Oracle you can do a left outer join in the where clause something like this SELECT t1.col1, t2.col2 FROM table1 t1, table2 t2 WHERE t1.join_col_name = t2.join_col_name(+) Does this not work in MySQL? Luckily, it

Re: WHERE vs. ON

2009-02-04 Thread Claudio Nanni
2009/2/4 Baron Schwartz ba...@xaprb.com On Tue, Feb 3, 2009 at 12:24 PM, Jerry Schwartz jschwa...@the-infoshop.com wrote: Somebody, I think it was somebody from MySQL, said that you should never put anything into a WHERE clause that could be put into the ON clause of a JOIN. My guess is

WHERE vs. ON

2009-02-03 Thread Jerry Schwartz
Somebody, I think it was somebody from MySQL, said that you should never put anything into a WHERE clause that could be put into the ON clause of a JOIN. My guess is that this helps with the optimization, but it seems counter-intuitive to me. I've never followed that advice, but I'm starting to

RE: WHERE vs. ON

2009-02-03 Thread Martin Gainty
@lists.mysql.com Subject: WHERE vs. ON Date: Tue, 3 Feb 2009 12:24:52 -0500 Somebody, I think it was somebody from MySQL, said that you should never put anything into a WHERE clause that could be put into the ON clause of a JOIN. My guess is that this helps with the optimization, but it seems counter

Re: WHERE vs. ON

2009-02-03 Thread Perrin Harkins
On Tue, Feb 3, 2009 at 12:24 PM, Jerry Schwartz jschwa...@the-infoshop.com wrote: Somebody, I think it was somebody from MySQL, said that you should never put anything into a WHERE clause that could be put into the ON clause of a JOIN. My guess is that this helps with the optimization, but it

Re: WHERE vs. ON

2009-02-03 Thread Rob Wultsch
On Tue, Feb 3, 2009 at 1:54 PM, Jerry Schwartz jschwa...@the-infoshop.com wrote: From: Martin Gainty [mailto:mgai...@hotmail.com] Sent: Tuesday, February 03, 2009 1:03 PM To: Jerry Schwartz; mysql@lists.mysql.com Subject: RE: WHERE vs. ON ON condition uses the same columnname from both source

RE: WHERE vs. ON

2009-02-03 Thread Jerry Schwartz
From: Martin Gainty [mailto:mgai...@hotmail.com] Sent: Tuesday, February 03, 2009 1:03 PM To: Jerry Schwartz; mysql@lists.mysql.com Subject: RE: WHERE vs. ON ON condition uses the same columnname from both source and target tables whereas any column expressions can go in the WHERE

Using = in WHERE vs HAVING clause

2005-02-22 Thread Rene Churchill
Good evening folks, I'm seeing some odd behavior in MySQL 4.0.21 running on Mac OS X 10.3.7 I'm trying to compare two identical tables and find the rows that are new/modified. I can't use a timestamp column because the new table is constantly regenerated. So I'm using a large WHERE clause and

Re: Using = in WHERE vs HAVING clause

2005-02-22 Thread SGreen
Rene Churchill [EMAIL PROTECTED] wrote on 02/22/2005 09:21:29 AM: Good evening folks, I'm seeing some odd behavior in MySQL 4.0.21 running on Mac OS X 10.3.7 I'm trying to compare two identical tables and find the rows that are new/modified. I can't use a timestamp column because the new

Re: Using = in WHERE vs HAVING clause

2005-02-22 Thread SGreen
Rene Churchill [EMAIL PROTECTED] wrote on 02/22/2005 04:23:47 PM: [EMAIL PROTECTED] wrote: Rene Churchill [EMAIL PROTECTED] wrote on 02/22/2005 03:39:05 PM: Hi Shawn, This is what I wound up going with: SELECT b.id, if(a.a = b.a, NULL, b.a), if(a.b

Re: Using = in WHERE vs HAVING clause

2005-02-22 Thread Rene Churchill
[EMAIL PROTECTED] wrote: This is what I wound up going with: SELECT b.id, if(a.a = b.a, NULL, b.a), if(a.b = b.b, NULL, b.b), if(a.c = b.c, NULL, b.c), (NOT (a.a = b.a) AND (a.b = b.b) AND (a.c =

Using = in WHERE vs HAVING clause

2005-02-21 Thread Rene Churchill
Good evening folks, I'm seeing some odd behavior in MySQL 4.0.21 running on Mac OS X 10.3.7 I'm trying to compare two identical tables and find the rows that are new/modified. I can't use a timestamp column because the new table is constantly regenerated. So I'm using a large WHERE clause and

optimising joins: where vs. using/on

2001-03-08 Thread Christian Hammers
Hello list While browsing old sources by a former employee I realised that he always did comma seperated joins and then a "where" FROM tablea a, tableb b, tablec c WHERE a.id=b.id and b.nr=c.nr whereas I learned to do FROM tablea a

Re: optimising joins: where vs. using/on

2001-03-08 Thread Steve Ruby
Christian Hammers wrote: Hello list While browsing old sources by a former employee I realised that he always did comma seperated joins and then a "where" FROM tablea a, tableb b, tablec c WHERE a.id=b.id and b.nr=c.nr whereas I learned to do

Re: optimising joins: where vs. using/on

2001-03-08 Thread Steve Ruby
Steve Ruby wrote: Christian Hammers wrote: Hello list While browsing old sources by a former employee I realised that he always did comma seperated joins and then a "where" FROM tablea a, tableb b, tablec c WHERE a.id=b.id and b.nr=c.nr

Re: optimising joins: where vs. using/on

2001-03-08 Thread Christian Hammers
On Thu, Mar 08, 2001 at 10:29:20AM -0700, Steve Ruby wrote: He is doing an inner join, you are doing a left join, they (potentialy) do not produce the same results. Hmm have to think about it... inner means fields where the right table has a NULL value in the condition are left out, right? If

Re: optimising joins: where vs. using/on

2001-03-08 Thread Steve Ruby
Christian Hammers wrote: On Thu, Mar 08, 2001 at 10:29:20AM -0700, Steve Ruby wrote: He is doing an inner join, you are doing a left join, they (potentialy) do not produce the same results. Hmm have to think about it... inner means fields where the right table has a NULL value in the

Re: optimising joins: where vs. using/on

2001-03-08 Thread Steve Ruby
Christian Hammers wrote: On Thu, Mar 08, 2001 at 10:29:20AM -0700, Steve Ruby wrote: He is doing an inner join, you are doing a left join, they (potentialy) do not produce the same results. Hmm have to think about it... inner means fields where the right table has a NULL value in the