title: i need a complex sql query to get employee history
body: <p>I have one employee shift table which contains an employee id, shit and date.
  actually i have daily inserting shifts for all employees. the table is looing like below one</p>
  
  <pre><code>Employee id       Shift      Date
  ----------------------------------
  1                   G        2017-11-01 
  1                   G        2017-11-02
  1                  NG        2017-11-03
  1                  NG        2017-11-04
  1                   G        2017-11-05
  1                   G        2017-11-06
  1                   G        2017-11-07
  1                   G        2017-11-08
  </code></pre>
  
  <p>I need output like below</p>
  
  <pre><code>Employee Id     Shift   From Date     To Date
  1                 G     2017-11-01    2017-11-02
  1                NG     2017-11-03    2017-11-04
  1                 G     2017-11-05    2017-11-08
  </code></pre>
  
  <p>Thanks in advance. please help to write a easy login without using loops.</p>