Lighten up! Participation here is voluntary.

Maxim gave you a good answer, as you provided no information about the table structure. I'd be wondering why you are using three tables, but that's probably another discussion. Based on what he gave you, and a little study you should be able to figure it out, otherwise query each table in turn & pick the most recent according to whatever criteria you use.

Have an index on the field which determines "most recent", check the max() function and side effects it may have on query speed.

Cheers - Miles Thompson

PS Why do you have three tables - is your data fully normalized?

At 03:19 PM 11/7/2002 -0500, Stephen wrote:
Did you not read what I asked? I have three tables, I need to get the newest
from whichever table has the newest piece of content.


----- Original Message -----
From: "Maxim Maletsky" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, November 07, 2002 12:46 PM
Subject: Re: [PHP] Getting Newest


>
> SELECT * FROM table ORDER BY date DESC
>
>
> --
> Maxim Maletsky
> [EMAIL PROTECTED]
>
>
>
> "Stephen" <[EMAIL PROTECTED]> wrote... :
>
> > Sorry, I'm using MySQL.
> >
> >
> > ----- Original Message -----
> > From: "Marco Tabini" <[EMAIL PROTECTED]>
> > To: "Stephen" <[EMAIL PROTECTED]>
> > Cc: "PHP List" <[EMAIL PROTECTED]>
> > Sent: Wednesday, November 06, 2002 4:00 PM
> > Subject: Re: [PHP] Getting Newest
> >
> >
> > > That depends on what DBMS you are using. Which one is it?
> > >
> > >
> > > Marco
> > > --
> > > ------------
> > > php|architect - The magazine for PHP Professionals
> > > The first monthly worldwide  magazine dedicated to PHP programmer
> > >
> > > Come visit us at http://www.phparch.com!
> > >
> > >
> >
> >
>
> --------------------------------------------------------------------------
--
> > ----
> >
> >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to