Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query suggestion #38

Open
chekos opened this issue Sep 14, 2020 · 0 comments
Open

Query suggestion #38

chekos opened this issue Sep 14, 2020 · 0 comments
Assignees
Labels
suggestion A canned query suggestion (to be included by default in future deployment)

Comments

@chekos
Copy link
Owner

chekos commented Sep 14, 2020

Multiple basis for search

query

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
)
@chekos chekos added the suggestion A canned query suggestion (to be included by default in future deployment) label Sep 14, 2020
@chekos chekos self-assigned this Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion A canned query suggestion (to be included by default in future deployment)
Projects
None yet
Development

No branches or pull requests

1 participant