title: MySql Trimming characters till a space
body: <p>How can I Trim (remove) all characters from the Right of a string upto the first space?</p>
  
  <p>Here's what I'm trying to do:</p>
  
  <pre><code>set @s:='May the Gods watch over your battles, my friend!';
  
  select if(length(@s) &lt; 10,@s,left(@s,10)) a;
  
  #output from above: 'May the Go'
  
  #desired output: 'May the'
  </code></pre>
  
  <p>To avoid such odd outputs like <code>May the Go</code> I'm trying to trim all characters from the right, upto the first space, so the output is <code>May the</code>. </p>
  
  <p>How can this be done in the sql statement itself. I could not find a built in function that'll do this?</p>