You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are around 100 child ids that have two records. When comparing the records base.rptPlacement and base.rptPlacement_Events it appeared that the ids we compared only had one adoption, not two.
In the base.episode_lf_entries table we have roughly 100 ids that suggest that the child had multiple adoptions, here's the query to find the duplicates.
SELECTid.id_prsn_child
,e.discharge_type
,e.state_fiscal_yyyyFROM
(SELECT
id_prsn_child
,COUNT(id_prsn_child) AS count
FROMbase.episode_lf_entriesGROUP BY id_prsn_child
HAVINGCOUNT(id_prsn_child) >1) AS id
LEFT JOINbase.episode_lf_entriesAS e
ONid.id_prsn_child=e.id_prsn_childWHERE discharge_type ='adoption'ORDER BYid.id_prsn_child
When I checked the ids against base.rptPlacement_Events, using the query below, it appears that most of these children have not had multiple adoptions.
SELECT*FROM
(SELECT
id_prsn_child
,COUNT(id_prsn_child) AS count
FROMbase.episode_lf_entriesGROUP BY id_prsn_child
HAVINGCOUNT(id_prsn_child) >1) AS id
LEFT JOINbase.rptPlacement_EventsAS pe
ONid.id_prsn_child=pe.childWHERE tx_end_rsn ='adoption'ORDER BYpe.child
Activity
gregorp commentedon May 7, 2015
It'd be nice to supplement this with a query to illustrate the problem... 2 months later I'm having trouble remembering exactly what this is.
oieeri26 commentedon May 7, 2015
In the base.episode_lf_entries table we have roughly 100 ids that suggest that the child had multiple adoptions, here's the query to find the duplicates.
When I checked the ids against base.rptPlacement_Events, using the query below, it appears that most of these children have not had multiple adoptions.