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, still working on validating data


SELECT A.*, b.*
FROM tablea a WHERE BLAH IN ( SELECT CORCOL BLAH FROM tableC WHERE c1 = 'c' AND c2= 'c' );



the first sql shouldnt even run, when you run the nested query alone, ie SELECT BLAH FROM tableC WHERE c1 = 'c' AND c2= 'c' it failes, column does not exist!


FYI I just verfied the data

the bugged sql runs fine, but completely ignored the nested query, when the column name did not match the column in the first table

not sure if this is a bug, feature, intended, but I know the work around now, alias the 2nd table column to make the name match the first table, and then it works fine


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to