title: group by first character
body: <p>I have a problem with a query in Oracle SQL.</p>
  
  <p>I have a <code>first_name</code> column in an <code>employees</code> table. I want to group my records according to the first character in <code>first_name</code>.</p>
  
  <p>For example, I have 26 records, one with <code>name = 'Alice'</code>, one with <code>name = 'Bob'</code>, and so on down the alphabet for each name's first character. After the query, there should be 26 groups with one employee each.</p>
  
  <p>I tried the following, but it's not working:</p>
  
  <pre><code>SELECT employee_id, (SUBSTR(first_name,1,1)) AS alpha FROM employees
  GROUP BY alpha;
  
  name_which_starts_from       employees  
  A                            10  
  B                            2  
  C                            4  
  D                            9  
  E                            3  
  G                            3  
  H                            3  
  I                            2  
  J                            16  
  K                            7  
  L                            6  
  M                            6  
  N                            4  
  O                            1  
  P                            6  
  R                            3  
  S                            13  
  T                            4  
  V                            2  
  W                            3  
  </code></pre>