Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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

Posts: 1
Name: kapil
Trades: 0
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
 
 
Register now for full access!
Old 12-07-2007, 10:29 PM Re: Group By Without Using Any Aggregate Function
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 12-18-2007, 02:45 AM Re: Group By Without Using Any Aggregate Function
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Are you trying to sort your rows? If so, you want ORDER BY, not GROUP BY.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 12-26-2007, 04:05 AM Re: Group By Without Using Any Aggregate Function
Novice Talker

Posts: 10
Name: Cookie
Trades: 0
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, 04:06 AM Re: Group By Without Using Any Aggregate Function
Novice Talker

Posts: 10
Name: Cookie
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.37732 seconds with 12 queries