Merging Sql Server Rows
WITH CTE AS (
    SELECT CustomerName 
        ,MobileNumber
        ,ROW_NUMBER() OVER (PARTITION BY MobileNumber ORDER BY CustomerName) AS rn
    FROM yourTable
)
UPDATE CTE
SET MobileNumber = NULL
WHERE rn &gt; 1;

This query uses common table expression to group rows by MobileNumber and assign them numbers in chosen order. I chose order by CustomerName to get the same results as in a question description. After that it updates all rows with row number greater than 1 and set MobileNumber to NULL for them.