title: SQL/Sybase query group by a substring of a column value
body: <p>I am making a simple select query with the following result - </p>
  
  <pre><code>select source_uri from image
  </code></pre>
  
  <p>--</p>
  
  <pre><code>source_uri
  
  "image/30022/A.jpg"
  "image/30022/B.jpg"
  "image/30022/C.jpg"
  "image/30022/D.jpg"
  "image/30023/A.jpg"
  "image/30023/B.jpg"
  "image/30023/C.jpg"
  "image/30023/D.jpg"
  "image/30024/A.jpg"
  "image/30024/B.jpg"
  "image/30024/C.jpg"
  "image/30024/D.jpg"
  </code></pre>
  
  <p>I want result like - </p>
  
  <pre><code>source_uri
  
  "image/30022/A.jpg"
  "image/30023/B.jpg"
  "image/30024/C.jpg"
  </code></pre>
  
  <p>I tried having a group by clause... but it doesnot group by since the values are different. </p>
  
  <p>--</p>
  
  <p>I am able to use the SUBSTRING_INDEX function in mySQL. </p>
  
  <p>Looking for the exact alternative in Sybase. </p>