Reply
Group By Without Using Any Aggregate Function
Old 12-07-2007, 12:58 AM Group By Without Using Any Aggregate Function
Junior Talker

Posts: 1
Name: kapil
Hi,

I want the select statement but i am using group by but i don't want to use any aggregate function on it . kindly suggest me the answer.

select empno, ename from emp group by deptid,empno;

Thank You,
kapsne_143 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 12-07-2007, 09:29 PM Re: Group By Without Using Any Aggregate Function
ForrestCroce's Avatar
Half Man, Half Amazing

Latest Blog Post:
Talapus Lake in June Snow
Posts: 3,022
Name: Forrest Croce
Location: Seattle, WA
If every field in your select list is also in the group by, you don't need aggregate functions to tell the database how to collapse multiple rows. In that case, you're probably better off using select distinct.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 12-18-2007, 01:45 AM Re: Group By Without Using Any Aggregate Function
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Are you trying to sort your rows? If so, you want ORDER BY, not GROUP BY.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 12-26-2007, 03:05 AM Re: Group By Without Using Any Aggregate Function
Novice Talker

Posts: 10
Name: Cookie
people talk about stuff i hav no clue about WAY too often.

oh, poo. I feel like a watermelon who dreamed she was a pickle.
brookittykat12 is offline
Reply With Quote
View Public Profile
 
Old 12-26-2007, 03:06 AM Re: Group By Without Using Any Aggregate Function
Novice Talker

Posts: 10
Name: Cookie
anyways...

ignorance is bliss, right? ain't that good?
brookittykat12 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Group By Without Using Any Aggregate Function
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14077 seconds with 13 queries