query takes a long time
query takes a long time
От:
Garry Saddington <garry@schoolteachers.co.uk>
Дата:
Can someone suggest how I could speed up the execution of this query?
select count(distinct attendance.studentid)
from attendance
where attendance.studentid not in (select studentid from attendance where auth not in('C','E','F','G','H','I','M','N','O','R','S','T','U'))
It returns the correct results but very slowly.
regards
garry
Re: query takes a long time
От:
"marcin mank" <marcin.mank@gmail.com>
Дата:
select count(distinct attendance.studentid)
from attendance
where attendance.studentid not in (select studentid from attendance where auth not in('C','E','F','G','H','I','M','N','O','R','S','T','U'))
select count(distinct attendance.studentid)
from attendance
where auth in('C','E','F','G','H','I','M','N','O','R','S','T','U')
?