title: SQL insert to fill an associative table with conditions
body: <p>I have two tables and an associative table between them (let's call them <code>Tab1</code>, <code>Tab2</code> and <code>ATab</code>).</p>
  
  <p><code>Tab1</code> and <code>Tab2</code> have those very same fields (for example purpose) :</p>
  
  <ul>
  <li><code>Id</code>.</li>
  <li><code>Name</code>.</li>
  </ul>
  
  <p>In my <code>ATab</code>, I want to insert record to associates <code>Tab1</code> and <code>Tab2</code> with their Ids.</p>
  
  <p>In order to do so, I would like to write my query in a sql script that say something like :</p>
  
  <p>I can manage to do something like :</p>
  
  <pre><code>INSERT INTO ATab(Tab1Id, Tab2Id) 
  SELECT Tab1.Id, ????? 
  FROM Tab1 WHERE Tab1.Name='Foo';
  </code></pre>
  
  <p>But I'm selecting only the <code>Foo</code> record of my first table... </p>
  
  <p>How would I manage to perform a "double" where clause ? Is it possible ?</p>