My code is like shown below :
select col1,count(col2) as col7 from --some join operation group by col1 having col7 >= 3 -- replace col7 by count(col2) to
You should select twice to use the count() column
select * from (select col1,count(col2) as col7 from --some join operation group by col1) as temp where temp.col7 >= 3