I have this table of data in MSSQL:
A | B |
---|---|
11 | 7.14285714285714 |
1 | 0.64935064935064 |
2 | 1.29870129870129 |
1 | 0.64935064935064 |
1 | 0.64935064935064 |
2 | 1.29870129870129 |
1 | 0.64935064935064 |
1 | 0.64935064935064 |
2 | 1.29870129870129 |
129 | 83.76623376623376 |
1 | 0.64935064935064 |
2 | 1.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:
A | B |
---|---|
11 | 7.14285714285714 |
129 | 83.76623376623376 |
Others | 9.0909090909091 |
I have tried grouping with having but that only returns either >5 or <5 so I would have to union 2 statements.