I figured out the answer. It is:
SELECT * FROM users WHERE added > (CURRENT_TIMESTAMP()
- INTERVAL 24 hour);
--- Andrew Tomazos <[EMAIL PROTECTED]> wrote:
> I am running MySQL 3.23.39.
>
> I have a column called "added" of type
> "timestamp(14)"
> in a table called "users".
>
> I set "added" to NULL on INSERTs in order to set it
> to
> the current time.
>
> I now want to SELECT all rows added in the last 24
> hours.
>
> SELECT * FROM users WHERE added > ... ?
>
> What is the correct way to write this statement? I
> want to say WHERE "added is greater than the
> currenttime minus 24 hours."
>
> I could not figure it out by reading section "6.3.4
> Date and Time Functions" of the documentation.
>
> Anyone know?
>
> Thanks in advance,
> Andrew.
>
>
> =====
> --
> Andrew Tomazos
> Primary: <[EMAIL PROTECTED]>
> Auxilary: <[EMAIL PROTECTED]>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant
> messaging with Yahoo! Messenger
> http://im.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
>
=====
--
Andrew Tomazos
Primary: <[EMAIL PROTECTED]>
Auxilary: <[EMAIL PROTECTED]>
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.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