I think there's nothing wrong with this:
Code:
select count(*) 
from temp 
where ano=an1 
AND ano=an2 
AND ano=an3 
AND ano=an4 
AND ano=an5
eugene:
Code:
select count(*) 
from temp 
where ano in (an1,an2,an3,an4,an5)
does not work. We can rewrite the IN() clause as "ano=an1 OR ano=an2 OR ano=an3 ... "
so the condition is true if AT LEAST ONE an? is equal to ano. But lnreddy needs to have ALL an? equal to ano.