Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Group records where value is

$
0
0

I have this table of data in MSSQL:

AB
117.14285714285714
10.64935064935064
21.29870129870129
10.64935064935064
10.64935064935064
21.29870129870129
10.64935064935064
10.64935064935064
21.29870129870129
12983.76623376623376
10.64935064935064
21.29870129870129

where B is the percentage of the total of A.

I would like to group all records where B is <5 into a single line while displaying individual lines for record >5%. In this instance there would be 3 rows of data:

AB
117.14285714285714
12983.76623376623376
Others9.0909090909091

I have tried grouping with having but that only returns either >5 or <5 so I would have to union 2 statements.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>