SQL Server group by alternative by subquery
<p>Can any of you guide me, which query will execute faster?</p>

<p>1st query:</p>

<pre><code>Select 
    t1.*, t2.CountDuplicate 
From 
    Table1 t1
Inner Join 
    (Select 
         ID, Name, Count(*) as CountDuplicate 
     From 
         Table1 
     Group By 
         ID, Name) t2 on t2.Id = t1.Id
</code></pre>

<p>2nd query:</p>

<pre><code>Select 
    t1.*, 
    (Select Count(t2.*) 
     From Table1 t2 
     Where t2.Id = t1.Id 
     Group By t2.ID, t2.Name) as CountDuplicate 
From 
    Table1 t1
</code></pre>