clear markdown compare help best fiddles feedback
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. 2591575 fiddles created (45741 in the last week).

create table t (id int); insert into t values (1),(1),(2),(1),(2);
5 rows affected
 hidden batch(es)

declare @cnt int; with ct as ( select id from t ) select @cnt = count(*) from ct where id = 1; select @cnt;
(No column name)
 hidden batch(es)