Latest Note for User

    Date: 01/16/06 (MySQL Communtiy)    Keywords: no keywords

    I'm working on a query that grabs a list of all the users plus the latest note for that user. The tables look something like this:

    user: id | email
    note: id | user | body | posted

    So I try something like this, but the body and the posted date don't match

    SELECT user.id, user.email, note.body, MAX(note.posted) FROM user JOIN note ON note.user = user.id GROUP BY user.id ORDER BY posted DESC LIMIT 20



    Any ideas on how to get this to work would be appreciated.

    Source: http://www.livejournal.com/community/mysql/82411.html

« Trying To Select Some Data || Fulltext index error »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home