• Post Reply Bookmark Topic Watch Topic
  • New Topic

select sum(columnName) from TableName groupby columnName , get same result without using groupby  RSS feed

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
able Name:emp


Question: how i can get same result without using group by.
 
Ranch Foreman
Posts: 3074
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you want to use GROUP BY?
That's part of its job.
 
Lalit Sahu
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:Why don't you want to use GROUP BY?
That's part of its job.


interviewer asked me above question
 
Dave Tolls
Ranch Foreman
Posts: 3074
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My response would be "why would you want to"?

You can do it in the SELECT clause itself, but it looks really messy.
Oh, and a DISTINCT on the Designation column.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!