Nov 9, 2004 #1 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!
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!
Nov 9, 2004 #2 SQLSister Programmer Jun 18, 2002 7,292 US 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 Upvote 0 Downvote
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
Nov 9, 2004 #3 PHV MIS Nov 8, 2002 53,708 FR 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 Upvote 0 Downvote
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