title: Insert results of subquery into table with a constant
body: <p>The outline of the tables in question are as follows:</p>
  
  <p>I have a table, lets call it join, that has two columns, both foreign keys to other tables. Let's call the two columns userid and buildingid so join looks like</p>
  
  <pre><code>+--------------+
  | join         |
  |--------------|
  |userid        |
  |buildingid    |
  +--------------+
  </code></pre>
  
  <p>I basically need to insert a bunch of rows into this table.  Each user will be assigned to multiple buildings by having multiple entries in this table.  So user 13 might be assigned to buildings 1, 2, and 3 by the following</p>
  
  <pre><code>13 1
  13 2
  13 3
  </code></pre>
  
  <p>I'm trying to figure out how to do this in a query if the building numbers are constant, that is, I'm assigning a group of people to the same buildings.  Basically, (this is wrong) I want to do </p>
  
  <pre><code>insert into join (userid, buildingid) values ((select userid from users), 1)
  </code></pre>
  
  <p>Does that make sense?  I've also tried using</p>
  
  <pre><code>select 1
  </code></pre>
  
  <p>The error I'm running into is that the subquery returns more than one result.  I also attempted to create a join, basically with a static select query that was also unsuccessful.</p>
  
  <p>Any thoughts?</p>
  
  <p>Thanks,
  Chris</p>