Tags for consecutive
SQL help - consecutive nights stay query
I have a table with the below sample data (minus 'desired output' column).  I need to figure out how to query that data to get the values in the 'desired output' column.  I only care about the EMPL_ID, DATE_IN, DATE_OUT data and want to determine the total number of consecutive nights the employee stayed in a hotel (no matter what hotel). 
sql consecutive