title: Postgresql query to return where all values of a column are false
body: <p>I have a tables for jobs and bids. Each job has many bids. There is a bid column "is_selected" that is a boolean. Only one bid can be is_selected=true for a job.</p>
  
  <p>My question is that I want to return the number of jobs where all bids are is_selected=false.</p>
  
  <p>So for example, </p>
  
  <pre><code>Job 1 has bids a=true, b=false, c=false, d=false 
  Job 2 has bids a=false, b=false, c=false
  Job 3 has bids a=false, b=false
  Job 4 has no bids
  </code></pre>
  
  <p>The result of this query should return a query with 3 jobs (only Job 1 has selected a bidder; so it should return job 2, 3, 4).</p>
  
  <p>How can this be done in postgresql or ActiveRecord/Rails?</p>
  
  <hr>
  
  <p>Update with data structure:</p>
  
  <p>3 tables</p>
  
  <p>Event (has_many jobs)</p>
  
  <p>Job (has_many bids, belongs_to event)</p>
  
  <ul>
  <li>event_id (integer)</li>
  </ul>
  
  <p>Bid (belongs_to job)</p>
  
  <ul>
  <li><p>job_id (integer)</p></li>
  <li><p>is_selected (Boolean)</p></li>
  </ul>