title: MySQL get all characters before specific character
body: <p>I have a table where I extract some values, one column values can contain "value1|value2|value3", but I only want to get the characters before the | - "value1".</p>
  
  <p>This is what I tried, but it doesn't work.. What am I doing wrong?
  Thanks!</p>
  
  <blockquote>
    <p>$sql = "SELECT * LEFT('Like', LOCATE('|', 'Like')-1) FROM $tablename
    WHERE <code>Parent</code> = '0' AND Type LIKE 'top' ORDER BY <code>Order</code> ASC";</p>
  </blockquote>
  
  <p>I want to use this for ALL values, not just one field..</p>