[web] sql question

Started by
1 comment, last by unknownProdigy 17 years, 10 months ago
I'm trying to make a table 'sometable' that has two columns: 'categoryid' and 'dateadded'. 'categoryid' is a foreign key to another table and 'dateadded' refers to a date object. Suppose that for each 'categoryid' value in the table, I want to get the lastest date only. How would you query that?
Advertisement

Hello,

Perhaps this might work :


select categoryid max(dateadded) from table
group by categoryid


kind regards
Uncle Remus
thanks a whole lot

This topic is closed to new replies.

Advertisement