mysql query question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

mysql query question

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

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