Date: January 20, 2013 05:32AM
I can't figure out the correct syntax. I have 2 tables like this:
articles_id (foreign key)
One can register several prices for one article. This way the price history for an article is kept.
I like to write a question that returns all articles, each with its newest price.
My try doesn't work:
SELECT article, price, date FROM articles, prices
WHERE articles.id = prices.articles_id
AND date = (SELECT MAX(date) FROM prices WHERE articles.id=prices.articles_id)
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.