title: SQL remove spaces between specific character in a string?
body: <p>I want to update a database table field using another field in the same table. Currently I have this table called sources. </p>
  
  <pre><code>Name    Code
  </code></pre>
  
  <p>In the name column I have values like this example :</p>
  
  <ol>
  <li>' Deals On Wheels '</li>
  <li>'Homesru - Abu Dhabi - Madinat Zayed Gold Centre'</li>
  </ol>
  
  <p>And I am having this update statement : </p>
  
  <pre><code>UPDATE Sources
  SET    Code = REPLACE((LTRIM(RTRIM(Name))),' ','-')
  </code></pre>
  
  <p>the result is : </p>
  
  <pre><code>Deals-On-Wheels-Al-Aweer
  </code></pre>
  
  <p>which is fine.</p>
  
  <p>but for second one  I have this :</p>
  
  <pre><code>Homesru---Abu-Dhabi---Madinat-Zayed-Gold-Centre
  </code></pre>
  
  <p>I want it to be like this : </p>
  
  <pre><code>Homesru-Abu-Dhabi-Madinat-Zayed-Gold-Centre
  </code></pre>
  
  <p>How can I Achieve this ? Any Help is appreciated.</p>