You can use group by to do this, read <a href="http://www.sqlservercentral.com/articles/Groouping/70023/">here</a>[<a href="http://www.sqlservercentral.com/articles/Groouping/70023/" target="_blank" title="New Window">^</a>]. I do think you need to hard code the different group names and use union, which is sub optimal.