Alright, I have student table and an attendance table.

  student table

student_id int(10)
name       varchar(60)
school     int(4)
district   int(4)

 attendance table

student_id      int(10)
status          varchar(4)
date            date    

Here is the query,

SELECT a.name,a.student_id,count(b.status) as count 
FROM student as a left join attendance as b
ON a.student_id = b.student_id
WHERE a.school='29'
GROUP BY (a.student_id) 
HAVING count='0'

The query works fine, but if I want to give a date range.  For instance
perfect attendance between 2001-09-10 and 2001-10-10, the query won't
work because the table is left joined.  The date value in the attendance
table will just return as NULL. Is there a way around this?

-Jason Yates


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to