You can use joins instead of subqueries if you cannot upgrade to 4.1.x of mysql.
Actually in my opinion joins are more efficient than subqueries. Subqueries (more often than not) tend to become bottlenecks in the long run.. http://dev.mysql.com has a some reference material about converting subqueries to joins hope that helps, Anoop On 1 Jun 2005 08:37:03 -0000, Felix Geerinckx <[EMAIL PROTECTED]> wrote: > > On 31/05/2005, Lucio Crusca wrote: > > > I use mysql 4.0.24 as found in debian gnu/linux sarge. > > mysql> select * from SAMPLES S1 where exists (select * from SAMPLES > > S2 where S1.ID <http://S1.ID> = S2.ID <http://S2.ID>); > > > > ERROR 1064: You have an error in your SQL syntax. Check the manual > > that corresponds to your MySQL server version for the right syntax to > > use near 'exists (select * from SAMPLES S2 where S1.ID <http://S1.ID> = > S2.ID <http://S2.ID>)' at > > line > > You need MySQL 4.1.x for subqueries. > > -- > felix > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > -- Thanks and best regards, Anoop