Try

delete table1.* from table1 inner join table2 on table2.x=table1.y

You may not need the ".*" in table1.* but I know it works with the ".*".

delete table1.* from table1, table2 where table2.x=table1.y

>From the manual
6.4.6 DELETE Syntax

DELETE [LOW_PRIORITY | QUICK] FROM table_name
    [WHERE where_definition]
    [ORDER BY ...]
    [LIMIT rows]

or

DELETE [LOW_PRIORITY | QUICK] table_name[.*] [table_name[.*] ...] FROM
table-references [WHERE where_definition]

Gordon Bruce
Interstate Software
A MySQL Training Partner

> -----Original Message-----
> From: Inandjo Taurel [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 18, 2002 10:37 AM
> To: [EMAIL PROTECTED]
> Subject: how to delete from one table based on external conditions?
> 
> hi,
> i would like to know how i can achieve this kind of query:
> delete form table1 where table2.x=table1.y
> I checked the manual, there nothing like that!
> Am using mysql 3.23.49
> 
> SQL SQL SQL SQL SQL
> 
> 
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <mysql-unsubscribe-
> [EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to