Database SQL Operation: Citizenship.searchForOverlap
Description: | Searches for citizenships for the specified concern role that overlap in time with the specified citizenship. |
Sterotype: | nsmulti |
SELECT
citizenshipID,
countryCode,
statusCode,
fromDate,
toDate
INTO
:citizenshipID,
:countryCode,
:statusCode,
:fromDate,
:toDate
FROM
Citizenship
WHERE citizenshipID <> :citizenshipID
AND concernRoleID = :concernRoleID
AND statusCode = :statusCode
AND countryCode = :countryCode
AND
(
(
:toDate >= fromDate
OR :toDate IS NULL
)
AND
(
:fromDate <= toDate
OR toDate IS NULL
)
)
|