RE: how to sub-select?..

2001-10-22 Thread Moshe Gurvich
nt_id=t_parent.task_id WHERE t_parent.task_id IS NULL -Original Message- From: Sergei Golubchik [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 3:52 PM To: Moshe Gurvich Cc: [EMAIL PROTECTED] Subject: Re: how to sub-select?.. Hi! On Oct 22, Moshe Gurvich wrote: > yeah, noticed

Re: how to sub-select?..

2001-10-22 Thread Sergei Golubchik
Hi! On Oct 22, Moshe Gurvich wrote: > yeah, noticed it after clicked send.. > > let's say i upgrade to MySQL 4.0 and run this query: > > DELETE FROM tasks as t_child LEFT JOIN tasks as t_parent ON > t_child.parent_id=t_parent.task_id > WHERE t_parent.task_id IS NULL > > > will this work? no.

RE: how to sub-select?..

2001-10-22 Thread Moshe Gurvich
le in JOIN structure? -Original Message- From: Sergei Golubchik [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 3:01 PM To: Moshe Gurvich Cc: [EMAIL PROTECTED] Subject: Re: how to sub-select?.. Hi! On Oct 22, Moshe Gurvich wrote: > thank you very much; > > i'm us

Re: how to sub-select?..

2001-10-22 Thread Sergei Golubchik
Hi! On Oct 22, Moshe Gurvich wrote: > thank you very much; > > i'm using right now v3.23 as recommended for production servers, but > anyway.. > > now, using the way you suggested, will this work: > > DELETE FROM tasks > FROM tasks as t_child LEFT JOIN tasks as t_parent ON > t_child.parent_id=

RE: how to sub-select?..

2001-10-22 Thread Moshe Gurvich
thanx :) -Original Message- From: Sergei Golubchik [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 1:57 PM To: Moshe Gurvich Cc: [EMAIL PROTECTED] Subject: Re: how to sub-select?.. Hi! On Oct 22, Moshe Gurvich wrote: > so what's the remedy? > how to do this task in MyS

Re: how to sub-select?..

2001-10-22 Thread Sergei Golubchik
Hi! On Oct 22, Moshe Gurvich wrote: > so what's the remedy? > how to do this task in MySQL without using subselects? > > > delete from followups where task_id not in (select task_id from tasks) > > Multi-table deletes (MySQL 4.0.0+) DELETE followups FROM followups LEFT JOIN tasks USING(task_id

Re: how to sub-select?..

2001-10-22 Thread Mark Maunder
Trond Eivind Glomsrød wrote: > "Moshe Gurvich" <[EMAIL PROTECTED]> writes: > > > I'm trying to run: > > > > delete from followups where task_id not in (select task_id from tasks) > > > > but it gives me an error: > > Error: 1064 - You have an error in your SQL syntax near 'select task_id from > >

RE: how to sub-select?..

2001-10-22 Thread Moshe Gurvich
so what's the remedy? how to do this task in MySQL without using subselects? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Trond Eivind Glomsrød Sent: Monday, October 22, 2001 1:13 PM To: Moshe Gurvich Cc: [EMAIL PROTECTED] Subject: Re: how t

Re: how to sub-select?..

2001-10-22 Thread Trond Eivind Glomsrød
"Moshe Gurvich" <[EMAIL PROTECTED]> writes: > I'm trying to run: > > delete from followups where task_id not in (select task_id from tasks) > > but it gives me an error: > Error: 1064 - You have an error in your SQL syntax near 'select task_id from > tasks)' at line 1 > > where's the problem a

how to sub-select?..

2001-10-22 Thread Moshe Gurvich
I'm trying to run: delete from followups where task_id not in (select task_id from tasks) but it gives me an error: Error: 1064 - You have an error in your SQL syntax near 'select task_id from tasks)' at line 1 where's the problem and how to work around? thank you --- Outgoing mail is certifie