Operation Details
Description: Searches for citizenships for the specified concern role that overlap in time with the specified citizenship.
Sterotype: nsmulti
SQL
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 
    ) 
  )