troubleshooting Question

SQL Select from 2 tables

Avatar of rdgit
rdgit asked on
Microsoft SQL ServerMicrosoft SQL Server 2005Microsoft SQL Server 2008
4 Comments1 Solution252 ViewsLast Modified:
I have a sql query question.
I have 2 tables... Projects and ProjComments

Projects has 2 fields ProjID and ProjName
ProjComments has 4 fields. ProjCommentID, ProjID, CommentDate and Comment

There can be several comments on one project

what sql code would I use to select all projects and only the most recent
comment for each project? Some projects won't have any comments.

so my results would include
ProjID, ProjName,  comment Date and Comment.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros