title: Sqlite- Show results in desired order
body: <p>I have created a sqlite table with two columns -<strong>Code</strong> and <strong>Name</strong> and stored data in it. User is provided a searchview to enter code or name and the app show results accordingly.</p>
  
  <p>I am using below query to fetch results-</p>
  
  <pre><code>cursor = db.query(TABLE_SEARCH, columns, COLUMN_CODE + " LIKE '" +
          searchText + "%' or " + COLUMN_ NAME + " LIKE '%" + searchText + "%'", null, null, null, null)
  </code></pre>
  
  <p>But the problem is that doesn’t show results in desired order.
  I want to show results in below order-</p>
  
  <p>1.On top show results with the Code exactly matching with the searched text.</p>
  
  <p>2.Below that show results with the Name  exactly matching with searched text.</p>
  
  <p>3.Below that show results with the Code starting with the searched text.</p>
  
  <p>4.Below that show results with the Name  containing the searched text.</p>
  
  <p>If I run multiple sqlite queries it makes the search slow.How can I accomplish my requirement in best way without affecting performance?</p>