MySQL : MySQL return first and last record for consecutive identical results