|
Legend: |
Primary key columns |
Columns with indexes |
Implied relationships |
Excluded column relationships |
< n > number of related tables |
|
|
Column |
Type |
Size |
Nulls |
Auto |
Default |
Children |
Parents |
CODE |
varchar2 |
30 |
|
|
|
|
|
DESCRIPTION |
varchar2 |
4000 |
√ |
|
null |
|
|
CODE_TYPE |
varchar2 |
30 |
|
|
|
|
|
NIBRS_CODE |
varchar2 |
30 |
|
|
|
|
|
CHILD_CODE_TYPE |
varchar2 |
30 |
√ |
|
null |
|
|
CHILD_CODE |
varchar2 |
30 |
√ |
|
null |
|
|
EXCLUSIVE_FLG |
varchar2 |
2 |
√ |
|
null |
|
|
Analyzed at Mon Sep 20 21:05 MDT 2021
|
View Definition:
SELECT ncp.code,
( CASE
WHEN ecr.child_code_type IS NOT NULL
AND ecr.child_code IS NOT NULL
THEN ecc.description
END
|| ''
|| CASE
WHEN ecr.child_code_type IS NULL OR ecr.child_code IS NULL
THEN ecd.description
END
) AS description,
ncp.code_type, ncp.nibrs_code, ecr.child_code_type, ecr.child_code,
( CASE
WHEN ecr.child_code_type IS NOT NULL
AND ecr.child_code IS NOT NULL
THEN ecc.exclusive_flg
END
|| ''
|| CASE
WHEN ecr.child_code_type IS NULL OR ecr.child_code IS NULL
THEN ecd.exclusive_flg
END
) AS exclusive_flg
FROM nibrs_code_ejs_mappings ncp INNER JOIN ejs_codes ecd
ON ecd.code_type = ncp.code_type AND ecd.code = ncp.code
LEFT OUTER JOIN ejs_codes_relations ecr
ON ecr.parent_code_type = ncp.code_type
AND ecr.parent_code = ncp.code
LEFT OUTER JOIN ejs_codes ecc
ON ecc.code_type = ecr.child_code_type
AND ecc.code = ecr.child_code
AND ecr.parent_code = ncp.code
WHERE ncp.code_type = 'INJURY_CODES'
Possibly Referenced Tables/Views: