Person‎ > ‎

PE07: Number of patients grouped by residence state location

This query is used to count the locations (location_id) across all person records. All possible values for location are summarized.


Sample query run:
The following is a sample run of the query.
SELECT NVL( state, 'XX' ) 
AS state_abbr, count(*) as Num_Persons_count FROM person LEFT OUTER JOIN location USING( location_id ) GROUP BY NVL( state, 'XX' ) ORDER BY 1
Output field list:
 Field  Description
State State of residence
Num_Persons_count Number of patients in the dataset residing in specific state

Sample output record:
 Field  Value
State MA
Num_Persons_count 1196292