clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3798847 fiddles created (41833 in the last week).

create table #MyTable ( Col_A varchar(5), Col_B int ) insert into #MyTable values ('A',1) insert into #MyTable values ('A',1) insert into #MyTable values ('A',2) insert into #MyTable values ('A',2) insert into #MyTable values ('A',2) insert into #MyTable values ('A',3) insert into #MyTable values ('B',4) insert into #MyTable values ('B',4) insert into #MyTable values ('B',5)
9 rows affected
 hidden batch(es)


-- Produces zero SELECT COUNT_BIG(*) FROM #MyTable AS MT WHERE 0 = 1; -- Produces no rows SELECT COUNT_BIG(*) FROM #MyTable AS MT WHERE 0 = 1 GROUP BY ();
(No column name)
0
(No column name)
 hidden batch(es)