hi people

this is the correct syntax:

"delete from TABLE_NAME where DATE_ADD(TIMESTAMP_COLUMN, interval 3 day) < 
now()"

the function to be used is outside the parenthesis, the column name inside; 
this way mysql applies the function to the column (using the specified 
parameters "interval..." compares it to the current date "now()" and then 
deletes the field if the where statement is true;

thanks to jamie from the php list for pointing me in the right direction

regards;


At 03:56 13/08/01, you wrote:
>dont ya have to specify what to delete?
>
>delete * from TABLE where TIMESTAMP='date, interval 3 day'
>
>I'm new to this as well but I think this might be closer
>
>let me know the answer
>
>-C
>----- Original Message -----
>From: "hassan el forkani" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, August 12, 2001 5:47 PM
>Subject: help (urgent!!!) with a query
>
>
> > hello;
> > can someone please help me with this query:
> >
> > "delete from TABLE_NAME where TIMESTAMP_COLUMN(date, interval 3 day) <
>now()"
> >
> > what i'm tryng to do is to delete all records that are 3 (or more) days
>old
> > i've looked around in the manual but couldn't find a "working answer",
>date
> > functions are only explained for select queries...
> >
> >
> > mysql version :3.23.33
> > server error : syntax error near'(date, interval 3 day)...
> >
> > regards
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.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 <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to