Re: Nested query bug

2005-02-02 Thread SGreen
matt_lists <[EMAIL PROTECTED]> wrote on 02/02/2005 08:50:16 AM: > Jay Blanchard wrote: > > >[snip] > > > > > >>>No, it isn't ignored...it just returns a FALSE for the IN statement > >>> > >>> > >[/snip] > > > >More info > > > >"The word IN is an alias for = ANY. Thus these two statements a

Re: Nested query bug

2005-02-02 Thread matt_lists
Jay Blanchard wrote: [snip] No, it isn't ignored...it just returns a FALSE for the IN statement [/snip] More info "The word IN is an alias for = ANY. Thus these two statements are the same: SELECT s1 FROM t1 WHERE s1 = ANY (SELECT s1 FROM t2); SELECT s1 FROM t1 WHERE s1 IN(SELE

RE: Nested query bug

2005-02-01 Thread Jay Blanchard
[snip] >> >> No, it isn't ignored...it just returns a FALSE for the IN statement [/snip] More info "The word IN is an alias for = ANY. Thus these two statements are the same: SELECT s1 FROM t1 WHERE s1 = ANY (SELECT s1 FROM t2); SELECT s1 FROM t1 WHERE s1 IN(SELECT s1 FROM t2); Howeve

RE: Nested query bug

2005-02-01 Thread Jay Blanchard
[snip] Not only that, shoudlnt it say "column does not exist?" It does not return an error, it ignores the whole nested query [/snip] Not really, because the entire sub query is being viewed as an OR condition (because of using IN). -- MySQL General Mailing List For list archives: http://lists

Re: Nested query bug

2005-02-01 Thread matt_lists
matt_lists wrote: Jay Blanchard wrote: [snip] the bug is, the nested query on the first statement is ignored [/snip] No, it isn't ignored...it just returns a FALSE for the IN statement False should give no records, it's an "IN ()" sense none match the condition instead it gives me every recor

Re: Nested query bug

2005-02-01 Thread matt_lists
Jay Blanchard wrote: [snip] the bug is, the nested query on the first statement is ignored [/snip] No, it isn't ignored...it just returns a FALSE for the IN statement False should give no records, it's an "IN ()" sense none match the condition instead it gives me every record?! -- MySQL General

RE: Nested query bug

2005-02-01 Thread Jay Blanchard
[snip] the bug is, the nested query on the first statement is ignored [/snip] No, it isn't ignored...it just returns a FALSE for the IN statement -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Nested query bug

2005-02-01 Thread matt_lists
Jay Blanchard wrote: [snip] SELECT A.*, b.* FROM tablea a WHERE BLAH IN ( SELECT CORCOL BLAH FROM tableC WHERE c1 = 'c' AND c2= 'c' ); [/snip] This query is just badly formed, for instance, where is the table aliased 'b' in your from statement? Are you showing the complete query? Here's th

RE: Nested query bug

2005-02-01 Thread Jay Blanchard
[snip] SELECT A.*, b.* FROM tablea a WHERE BLAH IN ( SELECT CORCOL BLAH FROM tableC WHERE c1 = 'c' AND c2= 'c' ); [/snip] This query is just badly formed, for instance, where is the table aliased 'b' in your from statement? Are you showing the complete query? -- MySQL General Mailing List Fo

Re: Nested query bug

2005-02-01 Thread matt_lists
matt_lists wrote: Having a strange bug with nested queries SELECT A.*, b.* FROM tablea a WHERE BLAH IN ( SELECT BLAH FROM tableC WHERE c1 = 'c' AND c2= 'c' ); this works, but it should not there is no "BLAH" column in table C If I change it to this, it works correctly, as far as I can tell,

Re: Nested query with GROUP BY ... HAVING COUNT(*) ... hangs 4.1.3 beta

2004-07-20 Thread Leo Siefert
Thanks for your response. >>> <[EMAIL PROTECTED]> 7/19/2004 11:47:39 AM >>> >It looks like your IN statement is forcing your inner SELECT to execute >once PER ROW of your main table. It is asking the engine to make sure that >_each and every_ id value in main meets the condition in the inner >

Re: Nested query with GROUP BY ... HAVING COUNT(*) ... hangs 4.1.3 beta

2004-07-19 Thread SGreen
It looks like your IN statement is forcing your inner SELECT to execute once PER ROW of your main table. It is asking the engine to make sure that _each and every_ id value in main meets the condition in the inner select. So, for each and every value in the table main, it has to re-computing t

Re: Nested query issue in MySQL 4.1

2003-05-29 Thread Victoria Reznichenko
"Bruno Batarelo" <[EMAIL PROTECTED]> wrote: > I have a problem to report. There is a SELECT query that selects data from > three tables according to certain criteria. It goes like this: > > SELECT bglavna.T001, bpolja.ID AS ID2, bpotpolja.TEKST > FROM (bglavna INNER JOIN bpolja ON bglavna.ID=bpolj

RE: Nested query

2002-05-11 Thread Roger Baklund
* Daren Cotter > I need to run a query that selects the usernames of all the members a > particular member has referred on the second level. So member 5 refers > 10, 11, and 12, I need the usernames of everyone referred by 10, 11, or > 12. Currently I run one query to get 10, 11, 12, make that a s