Re: Use select within delete

2007-11-14 Thread Dario Hernan
thanks all, I'll do it with a perl script!

Dario

2007/11/14, Ravi Kumar. <[EMAIL PROTECTED]>:
> Try this (I do not have 4.0.24 to try):
>
> delete table1.* from table1, table2 where table1.id = table2.id and
> date
> Ravi.
>
>
> On 11/13/07, mark addison <[EMAIL PROTECTED]> wrote:
> >
> > Dario Hernan wrote:
> > > Hi all I need to delete some fields from a table but in the where
> > > clause I need to put a select command.
> > > For instance, delete from table1 where id=(select id from table2 where
> > > date > > Is it possible in mysql 4.0.24??
> > >
> > > Thanks in advance
> > > Dario
> > >
> > >
> > Not until 4.1. What you can do instead is run the select into a temp
> > table and then run the delete as a join with that temp table.
> >
> > mark
> > --
> >
> >
> >
> >
> >
> >
> > MARK ADDISON
> > WEB DEVELOPER
> >
> > 200 GRAY'S INN ROAD
> > LONDON
> > WC1X 8XZ
> > UNITED KINGDOM
> > T +44 (0)20 7430 4678
> > F
> > E [EMAIL PROTECTED]
> > WWW.ITN.CO.UK
> >
> > P  Please consider the environment. Do you really need to print this
> email?
> > Please Note:
> >
> >
> >
> > Any views or opinions are solely those of the author and do not
> necessarily represent
> > those of Independent Television News Limited unless specifically stated.
> > This email and any files attached are confidential and intended solely for
> the use of the individual
> > or entity to which they are addressed.
> > If you have received this email in error, please notify
> [EMAIL PROTECTED]
> >
> > Please note that to ensure regulatory compliance and for the protection of
> our clients and business,
> > we may monitor and read messages sent to and from our systems.
> >
> > Thank You.
> >
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> >
> >
>
>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Use select within delete

2007-11-14 Thread Ravi Kumar.
Try this (I do not have 4.0.24 to try):

delete table1.* from table1, table2 where table1.id = table2.id and
date wrote:
>
> Dario Hernan wrote:
> > Hi all I need to delete some fields from a table but in the where
> > clause I need to put a select command.
> > For instance, delete from table1 where id=(select id from table2 where
> > date > Is it possible in mysql 4.0.24??
> >
> > Thanks in advance
> > Dario
> >
> >
> Not until 4.1. What you can do instead is run the select into a temp
> table and then run the delete as a join with that temp table.
>
> mark
> --
>
>
>
>
>
>
> MARK ADDISON
> WEB DEVELOPER
>
> 200 GRAY'S INN ROAD
> LONDON
> WC1X 8XZ
> UNITED KINGDOM
> T +44 (0)20 7430 4678
> F
> E [EMAIL PROTECTED]
> WWW.ITN.CO.UK
>
> P  Please consider the environment. Do you really need to print this
> email?
> Please Note:
>
>
>
> Any views or opinions are solely those of the author and do not
> necessarily represent
> those of Independent Television News Limited unless specifically stated.
> This email and any files attached are confidential and intended solely for
> the use of the individual
> or entity to which they are addressed.
> If you have received this email in error, please notify
> [EMAIL PROTECTED]
>
> Please note that to ensure regulatory compliance and for the protection of
> our clients and business,
> we may monitor and read messages sent to and from our systems.
>
> Thank You.
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>


Re: Use select within delete

2007-11-13 Thread mark addison

Dario Hernan wrote:

Hi all I need to delete some fields from a table but in the where
clause I need to put a select command.
For instance, delete from table1 where id=(select id from table2 where
date  
Not until 4.1. What you can do instead is run the select into a temp 
table and then run the delete as a join with that temp table.


mark
--






MARK ADDISON
WEB DEVELOPER

200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4678
F 
E [EMAIL PROTECTED]

WWW.ITN.CO.UK

P  Please consider the environment. Do you really need to print this email?
Please Note:



Any views or opinions are solely those of the author and do not necessarily represent 
those of Independent Television News Limited unless specifically stated. 
This email and any files attached are confidential and intended solely for the use of the individual
or entity to which they are addressed. 
If you have received this email in error, please notify [EMAIL PROTECTED] 


Please note that to ensure regulatory compliance and for the protection of our 
clients and business,
we may monitor and read messages sent to and from our systems.

Thank You.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]