Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select count(*) issue with oracle 8i

Status
Not open for further replies.

cyan01

Programmer
Mar 13, 2002
143
US
Hi, Experts,

I wrote a simple sql:

Code:
select count(*), fk1
from tb1
where count(*) < 10 // this line does not work
group by fk1
order by count(*)

Can someone show me how I can do this? Thanks!
 
Well I don;t know Oracle, but in SQL Server you need to use a having clause instead of a where clause.

Questions about posting. See faq183-874
 
Condition on aggregate function must be in the having clause.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top