title: Replace and Group By in SQL
body: <p>HI I want to group my results by a field that has had characters replaced but also keep the original value. </p>
  
  <p>This is what I have but I need to return the original URL value without changing the results.</p>
  
  <pre><code>select Count(ID) as TotalClicks, Replace(URL, '/', '') as DistinctURL
    from email_click_throughs
   where emailid = @ID
  group by  Replace(URL, '/', '')
  order by TotalClicks desc
  </code></pre>