Convert INT to BOOLEAN in a SQL SELECT for Multi-Tiered Sorting

john.kingTechnical Tips1 Comment

We have a family tree. Some people have children, while others do not. We want to sort results by alphabetically listing individuals with children in an initial group, and then those without children in a second group — also alphabetically. Let’s assume there is not an isParent column (nor the equivalent) on the table, but there is a way to determine how many children each individual has.