title: SQL query to get address city change on a date
body: <p>I have a query to find out the address details of an employee</p>
  <pre><code>Person_number           country     town/city   start_Date          end_date
  --------------------------------------------------------------------------------
  10                      CA          Toronto     01-feb-2022         10-feb-2022
  10                      CA          Ottawa      11-feb-2022         31-dec-4712
  
  11                      CA          Toronto     10-feb-2022         31-dec-4712
  
  12                      AB          Greenvilee  15-feb-2022         20-feb-2022
  12                      AB          Portvilee   21-feb-2022         31-dec-4712
  
  13                      CA          North york  01-feb-2022         09-feb-2022
  13                      CA          Waterloo    10-feb-2022         31-dec-4712
  </code></pre>
  <p>I want I want to create a query to get the data only for those employees whose town/city value has changed within the parameter date.</p>
  <p>For example: if I pass the parameter date as 01-feb-17-feb 2022, I should get the following output:</p>
  <pre><code>Person_number           country     current_town    previous_town   effective_date_ofchange
  10                       CA          Toronto            Ottawa          11-feb-2022 
  13                       CA          North york         Waterloo        10-feb-2022
  </code></pre>
  <p>person #11 will not come as there is no change within the date. Person#12 will not come as the change is after the parameter date.</p>
  <p>Can this be achieved with any analytical function ?</p>