How to get duplicate rows inclusive of first row number in SQL Server?
<p>I have written below query to retrieve duplicate customers using Row_Number() in SQL Server.</p>

<pre><code> Cust_PKID ---------------+ CustomerID ----------------- + MobileNo
 1                        | A00001                       | 9000477444   
 2                        | A00002                       | 9000477444
 3                        | A00003                       | 9000477444
</code></pre>

<p><strong>Query:-</strong></p>

<pre><code>Select TMP.CustID
From
(
   Select CustomerID CustID,
       Row_Number() Over(Partition By MobileNo Order By (Select Null)) As RowNo
   From dbo.Customers
) TMP
Where TMP.RowNo &gt; 1
</code></pre>

<p><strong>Output:-</strong></p>

<pre><code>Cust_PKID ---------------+ CustomerID ----------------- + MobileNo    
2                        | A00002                       | 9000477444
3                        | A00003                       | 9000477444
</code></pre>

<p>How can I retrieve records including of first RowNo record in single select statement? </p>