Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
perceptus
Starting Member
3 Posts |
Posted - 2012-10-04 : 23:58:54
|
I have a large amount data on the consumption of beverages and related information. I would like to query the one table likeSelect personname, sum(Calories), max(Calories) from tblbeersSum being the maximum amount of calories that the person consumed.Max being the maximum amount of calories that was consumed of all entries for the person.Sum and max give me the same information. Is there a work around or am i turning the screw the wrong way. |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2012-10-05 : 00:40:05
|
Please provide sample data and expected output--Chandu |
|
|
perceptus
Starting Member
3 Posts |
Posted - 2012-10-05 : 00:50:12
|
I am unsure about what you are asking. I gave what you asked just not in tabular form. do you want it in tabular form?I want to return the upper extreme and the mode for the values in calories for all beers consumed by one person. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-06 : 00:26:26
|
quote: Originally posted by perceptus I am unsure about what you are asking. I gave what you asked just not in tabular form. do you want it in tabular form?I want to return the upper extreme and the mode for the values in calories for all beers consumed by one person.
see how to post data for questionhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
sathiesh2005
Yak Posting Veteran
85 Posts |
Posted - 2012-10-18 : 07:11:27
|
Select personname, sum(Calories), max(Calories) from tblbeersGroup by personname@Sathiesh |
|
|
|
|
|