I have a comment table and a tag table. For each comment, there could be multiple tags, or none. I want to join the two so I can get a list of tags for each comment.
<
try this:
SELECT c.CommentID, c.Title, t.TagID FROM Comment as c
LEFT OUTER JOIN Tag as t ON c.CommentID = t.CommentID
edit1: If you want to return only one row per group as per the comment
SELECT c.CommentID, c.Title,MAX(t.TagID )
FROM Comment as c
left OUTER JOIN TagTable as t ON c.CommentID = t.CommentID
GROUP BY c.CommentID, c.Title