title: query sqllite database by the first letter of an entry
body: <p>I have created a TabLayout and I want to display the entries of my database by the selected tab. Here is the code snippet with the query: </p>
  
  <pre><code>public Cursor filteredItems(int tabPosition) throws SQLException {
          Log.d(TAG, "filteredItems called, Parameter: "+tabPosition); 
  
          String filter = ""; 
          if(tabPosition == 0){
              filter = "[a-cA-C]%";
          }else if(tabPosition == 1){
              filter = "[d-fD-F]%";
          }else{
              Log.d(TAG, "default tab"); 
              filter = "[a-zA-Z]%";
          }
  
          Cursor cursor = null;
          try{
              open();
              String query ="SELECT _id, surname, prename, street, zipcode, telephone, email FROM "+Database.getMyDbTable()+" " +
                      "WHERE surname LIKE '"+filter+"';";
              Log.d(TAG,"Query "+query);
              cursor = database.rawQuery(query, null);
          }catch(Exception ex){
              Log.e(TAG, "Could not get list");
              CharSequence text = dataNotFound;
              Toast toast = Toast.makeText(context, text, duration);
              toast.show();
          }
  
          return cursor;
      }
  </code></pre>
  
  <p>Unfortunately, the filter does not work - the result of the query is always empty(the table is not empty - I have checked it). </p>