I can’t get this sql query right…
I want the top 5 latest comments from tblComment. The problem is that I get more then one comment with the same ProductID. I don’t want that.
SELECT DISTINCT TOP 5
tblProduct.ProductID,
tblProduct.ProductName,
tblComment.DateAdded
FROM
tblComment
INNER JOIN
tblProduct ON tblProduct.ProductID = tblComment.ProductID
ORDER BY
tblComment.DateAdded DESC
What am I doing wrong?
Assuming your comment table has an id field try this: