clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2805490 fiddles created (40771 in the last week).

create table Limittime( ID int ,Times datetime )
 hidden batch(es)


insert into Limittime( ID,Times ) select isNull((select max(ID) from Limittime),0) + 1 as ID ,GetDate() Times where exists( select 0 from Limittime where datediff(minute,Times,GetDate()) < 15 having count(0) <= 1 )
1 rows affected
 hidden batch(es)


select * from Limittime
ID Times
1 2021-10-22 11:31:20.467
 hidden batch(es)


insert into Limittime( ID,Times ) select isNull((select max(ID) from Limittime),0) + 1 as ID ,GetDate() Times where exists( select 0 from Limittime where datediff(minute,Times,GetDate()) < 15 having count(0) <= 1 )
1 rows affected
 hidden batch(es)


select * from Limittime
ID Times
1 2021-10-22 11:31:20.467
2 2021-10-22 11:31:20.467
 hidden batch(es)


insert into Limittime( ID,Times ) select isNull((select max(ID) from Limittime),0) + 1 as ID ,GetDate() Times where exists( select 0 from Limittime where datediff(minute,Times,GetDate()) < 15 having count(0) <= 1 )
 hidden batch(es)


select * from Limittime
ID Times
1 2021-10-22 11:31:20.467
2 2021-10-22 11:31:20.467
 hidden batch(es)