Definition
Information
Section titled “Information”The Dbo Address model holds postal address details, including building or flat information, street, village, town, county and country code. It also records the postcode with and without spaces, address identifiers and search information, together with organisation information.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”dbo.location count per dbo.address
Section titled “dbo.location count per dbo.address”Count related dbo.location records for each dbo.address record, joined on addressid.
SELECT m."addressid", m."countrycode", COUNT(c."addressid") AS location_countFROM dbo.address AS mLEFT JOIN dbo.location AS c ON m."addressid" = c."addressid" AND m."organisation" = c."organisation"GROUP BY m."addressid", m."countrycode"ORDER BY location_count DESC;dbo.location records with dbo.address details
Section titled “dbo.location records with dbo.address details”List dbo.location records with the dbo.address values they reference through addressid.
SELECT c."locationid", c."closedate", m."addressid", m."countrycode" AS "address_countrycode"FROM dbo.location AS cINNER JOIN dbo.address AS m ON m."addressid" = c."addressid" AND m."organisation" = c."organisation";dbo.patientadditionaladdress count per dbo.address
Section titled “dbo.patientadditionaladdress count per dbo.address”Count related dbo.patientadditionaladdress records for each dbo.address record, joined on addressid.
SELECT m."addressid", m."countrycode", COUNT(c."addressid") AS patientadditionaladdress_countFROM dbo.address AS mLEFT JOIN dbo.patientadditionaladdress AS c ON m."addressid" = c."addressid" AND m."organisation" = c."organisation"GROUP BY m."addressid", m."countrycode"ORDER BY patientadditionaladdress_count DESC;