title: Counting rows in mysql
body: <p>I have a mysql problem, my query looks as follows but not complete</p>
  
  <pre><code>SELECT
      s.name,
      s.surname
  FROM
      students as s,
      practical as p,
      days_attend as d
  WHERE
      s.sid = p.sid
  AND
      s.sid = d.sid
  </code></pre>
  
  <p>The scenario is the user may enter in a form to search how many days the student has been absent, eg if he enters 5 it will bring up all students that have been absent for 5days. The problem however is every day the admin enters if the student is absent or not</p>
  
  <p>eg.</p>
  
  <p>TABLE: days_attend</p>
  
  <pre><code>id   sid  date        absent
  1    1    2009-10-26  yes
  2    1    2009-10-27  yes
  3    1    2009-10-28  no
  4    1    2009-10-29  yes
  5    1    2009-10-30  yes
  6    1    2009-10-31  no
  7    1    2009-11-01  yes
  </code></pre>
  
  <p>I need to count the amount 5 rows where there are yes in column absent. he where count(absent) = 5?</p>