DECLARE @tbl AS TABLE ( Id INT IDENTITY (1,1),Teacherid INT,StartTime DATETIME,EndTime DATETIME )
INSERT INTO @tbl
(Teacherid, StartTime, EndTime)
VALUES
(1254, '2007-11-29 09:00 AM','2007-11-29 10:00 AM'),
(1254, '2007-11-29 11:30 AM','2007-11-29 1:00 PM'),
(1254, '2007-11-30 09:00 AM','2007-11-30 10:00 AM'),
(1254, '2007-11-30 11:30 AM','2007-11-30 1:00 PM'),
(1254, '2007-12-01 09:00 AM','2007-12-01 10:00 AM'),
(1254, '2007-12-01 11:30 AM','2007-12-01 1:00 PM')
SELECT t.EndTime, t2.StartTime
FROM @tbl t LEFT JOIN @tbl t2 ON t2.Id = t.Id+1
please take close look at the table strucrure i have entered all days not just the interval
hope you understand and more over this is just a sample you may decide your own logic