List:General Discussion« Previous MessageNext Message »
From:Stephen Fromm Date:December 3 2003 6:16pm
Subject:Re: Join only the latest entry...
View as plain text  
----- Original Message ----- 
From: "Ville Mattila" <ville.mattila@stripped>
To: <mysql@stripped>
Sent: Wednesday, December 03, 2003 4:07 AM
Subject: Join only the latest entry...


> Hello there,
>
> I have a table including information about my projects, the structure
> has each id and name. Then I have another table including status
> information of each project: entryid, projectid, status and timestamp.
>
> Is there any possibility to fetch a list of projects with the most
> recent status by one query? I can do it of course by two different
> queries, but I don't find it as very good solution.

Have you tried a straightforward join?  Something like
SELECT table1.name FROM table1, table2
WHERE table1.id = table2.entryid AND
              {expressing constraining the date in table2 to be fairly
recent}

>
> Thanks,
> Ville
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
http://lists.mysql.com/mysql?unsub=1
>

Thread
Join only the latest entry...Ville Mattila3 Dec
  • Re: Join only the latest entry...Stephen Fromm3 Dec
  • Re: Join only the latest entry...Skippy3 Dec
  • Re: Join only the latest entry...Roger Baklund3 Dec