T-SQL Query: Select a row in one table based on data in another table

tcianflone used Ask the Experts™
I have two related tables, template and templine. They both have a template field that contains the template name and that's how they relate to each other. I need to select records in templine based on a field that appears only in template. Something like this:

select * from templine where template.type='M'

I don't know how to express template.type (which is supposed to find the type field in the template table) properly so that the query will run. Thanks.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try with an SQL JOIN query;

FROM templine JOIN template
ON templine.name = template.name
WHERE template.type = 'M'



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial