Hey, I have this query:
SELECT page.id, revision.title, revision.number
FROM page
INNER JOIN revision ON page.id = revision.pageId
Which will return something like:
"1" "Page Version A" "1"
"1" "Page Version B" "2"
"1" "Page Version C" "3"
Now I only want to return one row for each page, with the data from the latest (highest numbered) revision. If I do:
SELECT page.id, revision.title, revision.number
FROM page
INNER JOIN revision ON page.id = revision.pageId
GROUP BY page.id
I get:
"1" "Page Version A" "1"
But I want:
"1" "Page Version C" "3"
Any ideas? Thanks.