About
Pricing
Community
Teams
Start Free Trial
Log in
jackjohnson44
asked on
12/22/2012
sql group on number range, not exact number
I have a column with a decimal which is a percentage .76, .24, 1.
I want to group on this column, but in .1 pt range, meaning group 0-.09, .1-.19, .2-.29.
Microsoft SQL Server
Microsoft SQL Server 2008
C#
6
3
Last Comment
Steve Wales
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Steve Wales
12/22/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Qlemo
12/22/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Qlemo
12/22/2012
Output as range text can be managed with
convert(varchar(4), percent_grp) + ' - ' + convert(varchar(4), percent_grp + 0.09)
SOLUTION
Steve Wales
12/22/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Qlemo
12/22/2012
sjwales,
score is now truncated twice, which does not matter for the result, but is superfluous.
Steve Wales
12/22/2012
Oops! You're right:
Joys of copy and paste :)
Your help has saved me hundreds of hours of internet surfing.
fblack61
convert(varchar(4), percent_grp) + ' - ' + convert(varchar(4), percent_grp + 0.09)