Hi Ahmed,
If you meant IDs greater than 100 then you should add another condition to your where clauses by using an
and keyword (and its very obvious and I'm sure that you are aware of that) :
select count(*) , trunc(a.Date),d.cita
from dbdev.sub a , dbdev.num b, dbdev.dis c , dbdev.cit d
where a.sen=b.mo
and b.di =c.id
and c.id =d.id
and a.date >=trunc(to_Date('01/01/2011','dd/mm/yyyy'))
and a.date <trunc(sysdate)>
and a.id >= 100
group by trunc(a.Date) ,d.cita
order by trunc(a.Date)
But I guess that you want all counts which are greater than 100. in that case you should use
HAVING clause :
select count(*) , trunc(a.Date),d.cita
from dbdev.sub a , dbdev.num b, dbdev.dis c , dbdev.cit d
where a.sen=b.mo
and b.di =c.id
and c.id =d.id
and a.date >=trunc(to_Date('01/01/2011','dd/mm/yyyy'))
and a.date <trunc(sysdate)>
group by trunc(a.Date) ,d.cita
having count(*)>=100
order by trunc(a.Date)
Hope it helps.