Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • 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.
 
Rancher
Posts: 3492
39
  • 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
Rancher
Posts: 3492
39
  • 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.
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!