I have a Summary table (data_summary) and a Summary Details table (data_summary_dtl). I'm applying the following query in data_summary_dtl table to get the
Number of records in detail table for each record in the summary table,select data if count is greater than 2
select summary_gid,COUNT(summary_gid) as varCount
from data_summary_dtl
group by summary_gid;
I can list the summary_id along with the count using the following query,
Which gives fine result for me, now my question is that how can i obtain the result of records that having count greater than 2.
i had tried the following but not get the result as expected:
select summary_gid,COUNT(summary_gid) as varCount
from data_summary_dtl
where varCount > 2
group by summary_gid;
select summary_gid,COUNT(summary_gid) as varCount
from data_summary_dtl
where COUNT(summary_gid) > 2
group by summary_gid;
Is there any other possibility to get the result?