SQL query between tables

I have two SQL tables.  What I am trying to do is write a query that displays the 'ProjectName' field from table1 and only displays the ProjectName field from table1 where the ProjectId in table1 exists in table2.  I can't figure out how to write the query
Who is Participating?
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
SELECT Table1.ProjectName
FROM Table1
INNER JOIN Table2 ON Table1.ProjectID= Table2.ProjectID

or <although not recommended if Table2 is large>

SELECT ProjectName
FROM Table1
WHERE ProjectID IN (SELECT ProjectID FROM Table2)
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Thanks for the grade.  Good luck with your project.  -Jim
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.