Re: Subqueries in MySQL < 4.1

2006-08-23 Thread Jay Pipes
On Wed, 2006-08-23 at 22:23 +0200, spacemarc wrote: > Hi, > I have a query like this: > > SELECT table1.*,( > SELECT COUNT( field2 ) > FROM table2 > WHERE id=10 > ) AS total > FROM table1 > GROUP BY id > LIMIT 1 > > but the subqueries do not work with mysql < 4.1. How can I convert it > (or make

Re: Subqueries in MySQL < 4.1

2006-08-23 Thread Dan Buettner
See http://dev.mysql.com/doc/refman/5.0/en/rewriting-subqueries.html for some tips Dan On 8/23/06, spacemarc <[EMAIL PROTECTED]> wrote: Hi, I have a query like this: SELECT table1.*,( SELECT COUNT( field2 ) FROM table2 WHERE id=10 ) AS total FROM table1 GROUP BY id LIMIT 1 but the subqueries

Subqueries in MySQL < 4.1

2006-08-23 Thread spacemarc
Hi, I have a query like this: SELECT table1.*,( SELECT COUNT( field2 ) FROM table2 WHERE id=10 ) AS total FROM table1 GROUP BY id LIMIT 1 but the subqueries do not work with mysql < 4.1. How can I convert it (or make to work) in MySQL 3.x, 4.0 possibly in one only query? thanks -- http://www.sp