Page 1 of 1

mysql query question

Posted: Mon Mar 24, 2003 7:16 am
by Guy
these two queries work in mssql and doesnt in mysql any ideas?

Code: Select all

select count(*) as count from table1 where field1 in(select ID from table2 where field2 = 'Value1')
and this also deosnt work:

Code: Select all

select count(*) as count from table1 where field1 = (select ID from table2 where field2 = 'Value1')
thanks
Guy

Posted: Mon Mar 24, 2003 7:20 am
by twigletmac
This is because MySQL 3 does not support sub selects.

MySQL 4.1 does though:
http://www.mysql.com/doc/en/ANSI_diff_Sub-selects.html

Mac