Query bug

2011-07-24 Thread Velen Vydelingum
Hi, I have the following query which is fine when I run it from the mysql shell screen: select supplier_code,0,0,0,0,0-sum(amountpaid),0 from custpayments where paymentdate='2010-12-02' and grnno not in (Select sale_id from saletrans_cons where paymode='Credit') group by supplier_code but

Re: Query bug

2011-07-24 Thread Johnny Withers
What's your vb code for outputting the results look like? On Jul 24, 2011 8:22 AM, Velen Vydelingum ve...@biz-mu.com wrote: Hi, I have the following query which is fine when I run it from the mysql shell screen: select supplier_code,0,0,0,0,0-sum(amountpaid),0 from custpayments where

Re: Query bug

2011-07-24 Thread Velen Vydelingum
- From: Johnny Withers joh...@pixelated.net To: Velen Vydelingum ve...@biz-mu.com Cc: mysql@lists.mysql.com Sent: Sunday, July 24, 2011 17:41 Subject: Re: Query bug What's your vb code for outputting the results look like? On Jul 24, 2011 8:22 AM, Velen Vydelingum ve...@biz-mu.com wrote: Hi

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

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 are the same: SELECT s1 FROM

Nested query bug

2005-02-01 Thread matt_lists
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, still working on

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 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

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

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] 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 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

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:

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); However,