SELECT
*
FROM
(SELECT
TOTAL_BFS,
SUM(TOTAL_BFS) as N
from
(select
UNIQUE_ID,
BFS_CONSENT_GIVEN +
BFS_OFFICER_SAFETY +
BFS_SEARCH_WARRANT +
BFS_PAROLE +
BFS_SUSPECT_WEAPON +
BFS_VISIBLE_CONTRABAND +
BFS_ODOR_CONTRABAND +
BFS_CANINE_DETECT +
BFS_EVIDENCE +
BFS_INCIDENT +
BFS_EXIGENT_CIRCUM +
BFS_VEHICLE_INVENT +
BFS_SCHOOL_POLICY as TOTAL_BFS
from
basis_for_search
order by
TOTAL_BFS DESC
)
where total_bfs > 0
group by total_bfs
)
Multiple basis for search
query