I have a MySQL table with the following fields:
starttime and endtime are MyS
starttime
endtime
Try this:
declare @tempTbl table(RecID) insert into @tempTbl Select RecID from ( Select t.RecID from Table1 t,Table1 t1 where t.StartTime between t1.StartTime AND t1.EndTime AND t.RecID <> t1.RecID )