title: MySQL query; if greater than a value 'yes' else 'no'; grouping
body: <p>I have this data in a table:</p>
  
  <pre>
  id  account status
  1      8       1
  2      8       4
  4      8       3
  5      8       1
  6      1       4
  7      1       3
  </pre>
  
  <p>I want a single query to return me the account number, and if any of the status' for that account is <strong>&lt;3</strong> then return 'Yes' else 'No'. So, these results:</p>
  
  <pre>
  account pending
  8          'Yes'
  1          'No'
  </pre>
  
  <p>I had:</p>
  
  <p><code>
  SELECT account, IF(status>2,'No','Yes') as pending FROM table GROUP BY account;
  </code></p>
  
  <p>But it only seems to take into account the first row for each account. (ex. id 1's status=1 so even if id 4's status is changed so status=1, it'll still think all is greater than 2.)</p>
  
  <p>I really appreciate any help. I normally can do decent query design, but this is giving me a brain cramp. :)</p>