Home » SQL & PL/SQL » SQL & PL/SQL » AGGREGATE FUNCTIONS (ORACLE 9i)
AGGREGATE FUNCTIONS [message #345949] Fri, 05 September 2008 07:00 Go to next message
anuragsv
Messages: 5
Registered: September 2008
Junior Member

Dear All,

I want to know  whether we can use Group by clause before having clause or after having clause in sql.

Regards
Anuragsv


Re: AGGREGATE FUNCTIONS [message #345952 is a reply to message #345949] Fri, 05 September 2008 07:02 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Open SQL*Plus session and try both options; you'll easily find the answer by yourself.
Re: AGGREGATE FUNCTIONS [message #345956 is a reply to message #345952] Fri, 05 September 2008 07:04 Go to previous messageGo to next message
anuragsv
Messages: 5
Registered: September 2008
Junior Member

Thank you so much for your Support

Re: AGGREGATE FUNCTIONS [message #345958 is a reply to message #345956] Fri, 05 September 2008 07:09 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Oh, no problem, it can hardly be called a "support".

Please, read the OraFAQ Forum Guide to get familiar with certain rules that apply while on this Forum.

There's no need to use [code] tags when posting an ordinary text message, but it will be great if you use them every time you post a piece of code.
Re: AGGREGATE FUNCTIONS [message #345978 is a reply to message #345956] Fri, 05 September 2008 07:56 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Come on - how idle do you have to be not to try it for yourself?

Try these, and be amazed at how siple learning can be:
select col_1,count(col_2)
from  (select 1 col_1, 2 col_2
       from   dual)
group by col_1
having count(col_2) >= 1;

select col_1,count(col_2)
from  (select 1 col_1, 2 col_2
       from   dual)
having count(col_2) >= 1
group by col_1;


By the way - support is what you pay Oracle for. we do this for fun mostly. If you're not happy, we'll gladly refund every penny you've paid us.
Previous Topic: Regarding passing Array as a argument in the stored procedure/Function
Next Topic: Using updated values and inserting into table (merged)
Goto Forum:
  


Current Time: Sat Dec 03 14:21:15 CST 2016

Total time taken to generate the page: 0.12959 seconds