SQL Server 2008 SP: Nested Select Possible?
I am new to SQL server (just 2 days).  I have two tables.

One table is State_Manager (fields: name, email, state)

One table is Employee (fields: Name, State)

Common key is State.

What I need to do is loop through State_Manager table, using the field "State" and loop through the Employee table to pull out names of all employees in that state.

Then using EXEC msdb.dbo.sp_send_dbmail to email each state manager the list of employees in their state.

This is like a nested FOR loops in Programming 101. 

But I have no idea how to implement it in SQL server.
SQL Server 2008 SP: Nested Select Possible?
===

I am new to SQL server (just 2 days).  I have two tables.

One table is State_Manager (fields: name, email, state)

One table is Employee (fields: Name, State)

Common key is State.

What I need to do is loop through State_Manager table, using the field "State" and loop through the Employee table to pull out names of all employees in that state.

Then using EXEC msdb.dbo.sp_send_dbmail to email each state manager the list of employees in their state.

This is like a nested FOR loops in Programming 101. 

But I have no idea how to implement it in SQL server.