Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

There are 19 Trust rows that are duplicated

select TrustName, trustNumber, status, count(*) 
from [HEELIVE].[vwTrust]
group by TrustName, trustNumber, status
having count(*) > 1
order by 3, 4 desc
TrustNametrustNumberstatusRowCount
NULLNULLCurrent3
NULLBATHCurrent2
NULLBRISCurrent2
NULLGLOSCurrent2
NULLQD6Current2
NULLQDXCurrent2
NULLSOMCurrent2
NULLSWICurrent2
UndefinedUNDCurrent2
Wiltshire Council817Current2
Worcestershire PCTNULLCurrent2
NULLNULLInactive6
NULLZZZZZInactive3
NULLRECRUInactive3
NULLRT5EJInactive2
NULLMATInactive2
John Coupland HospitalNULLInactive2
ZZZ John Coupland HospitalNULLInactive2
NULL??RWMInactive2

Trust Name and Number duplicates

select lo.LocalOfficeName, t.*
from [HEELIVE].[vwTrust] as t
left join [HEELIVE].[vwLocalOffice] as lo ON (lo.itemtype = 'Trust' and lo.UniqueID = t.TrustID)
where status = 'Current'
and ISNULL(TrustName, -1) + ISNULL(trustNumber,-2) in (select ISNULL(TrustName, -1) + ISNULL(trustNumber,-2)
													   from [HEELIVE].[vwTrust]
													   where status = 'Current'
													   group by TrustName, trustNumber
													   having count(*) > 1)
order by trustName, TrustNumber


LocalOfficeNameRecordOriginSTATUSTrustNameTrustKnownAsTrustNumberDeaneryLETBTrustID
HESWHEELIVECurrentNULLBath VTSBATHSevern Local Office - HESW36090056
NULLHEELIVECurrentNULLBath VTSBATHSevern Local Office - HESW32948533
HESWHEELIVECurrentNULLBristol VTSBRISSevern Local Office - HESW36090050
NULLHEELIVECurrentNULLBristol VTSBRISSevern Local Office - HESW32948605
HESWHEELIVECurrentNULLGloucestershire VTSGLOSSevern Local Office - HESW36090059
NULLHEELIVECurrentNULLGloucestershire VTSGLOSSevern Local Office - HESW32948528
HENEHEELIVECurrentNULLHealth Education South WestNULLNULL29034540
HESWHEELIVECurrentNULLDeferred TraineeNULLSevern Local Office - HESW36090055
NULLHEELIVECurrentNULLDeferred TraineeNULLSevern Local Office - HESW33643819
HESWHEELIVECurrentNULLS & W Devon Health AuthorityQD6Peninsula Local Office - HESW36090058
NULLHEELIVECurrentNULLS & W Devon Health AuthorityQD6Peninsula Local Office - HESW33643809
HESWHEELIVECurrentNULLNorth and East Devon Health AuthorityQDXPeninsula Local Office - HESW36090054
NULLHEELIVECurrentNULLNorth and East Devon Health AuthorityQDXPeninsula Local Office - HESW32948568
HESWHEELIVECurrentNULLSomerset VTSSOMSevern Local Office - HESW36090057
NULLHEELIVECurrentNULLSomerset VTSSOMSevern Local Office - HESW32948661
HESWHEELIVECurrentNULLSwindon VTSSWISevern Local Office - HESW36090052
NULLHEELIVECurrentNULLSwindon VTSSWISevern Local Office - HESW32948634
HEEMHEELIVECurrentUndefinedUndefinedUNDHealth Education England West Midlands275385639
HEEOEHEELIVECurrentUndefinedUndefinedUNDHealth Education England West Midlands275385639
HELASEHEELIVECurrentUndefinedUndefinedUNDHealth Education England West Midlands275385639
HESWHEELIVECurrentUndefinedUndefinedUNDHealth Education England West Midlands275385639
HEWMHEELIVECurrentUndefinedUndefinedUNDHealth Education England West Midlands275385639
HEWTVHEELIVECurrentUndefinedUndefinedUNDNULL275385640
HESWHEELIVECurrentWiltshire CouncilWiltshire Council817Severn Local Office - HESW32948539
HEWTVHEELIVECurrentWiltshire CouncilWiltshire Council (817 / 1-AHNGU3)817Health Education England Wessex276017384
HESWHEELIVECurrentWorcestershire PCTWorcestershire PCTNULLNULL36093376
NULLHEELIVECurrentWorcestershire PCTWorcestershire PCTNULLNULL32948547

Red rows above signify that the LocalOffice field has not been set for these trust rows, and probably being done to aid the filtering out of these duplicated Trusts

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.