title: How to select first 3 values from a mysql concetenated column
body: <p>I have a column in a table called multi_values.</p>
  <p>In that column I am inserting multiple values by using + separator.</p>
  <p>For example</p>
  <p><code>01234567891111+01234567891112+01234567891113+01234567891114</code></p>
  <p>This column may contain some times two values , some times 4 values dynamically.</p>
  <p>So I would like to get first 3 values from that column.</p>
  <p>If that column contains only 2 values then 2 , if it contains only one value then one.</p>
  <p>I tried with mysql substring.</p>
  <p>But the values are not fixed length in that column.</p>
  <p>So I need a select query to get first 3 values from that column.</p>
  <p>Any help would be greatly appreciated.</p>
  <pre><code>`Answer`
  </code></pre>
  <p>At the time of inserting in that particular column values are inserting starting with + sign. Like +123+2344+34563 like this. So here is the solution.</p>
  <p><code>SUBSTR(</code>column_name<code>,2)</code>  . So this will remove the first + sign.
  Below one giving what I expect
  <code>SUBSTRING_INDEX(SUBSTR(</code>column_name<code>,2),'+',3)</code>.
  So it will return 3 Ids.</p>