title: How to set datatype in SQLiteDatabase raw query binding?
body: <p>Arguments in SQLiteDatabase <a href="http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#rawQuery%28java.lang.String,%20java.lang.String%5B%5D%29" rel="nofollow">raw query</a> function are bound as <strong>Strings</strong> and it causes problems for me.</p>
  
  <p>Example query (binding <strong>50</strong>):</p>
  
  <pre><code>    SELECT ? &lt; 68
  </code></pre>
  
  <p>returns: <code>0</code></p>
  
  <pre><code>    SELECT min(?, 68)
  </code></pre>
  
  <p>returns: <code>68</code></p>
  
  <p>Such results are because <code>50</code> is bound as String and query looks like <code>SELECT '50' &lt; 68 ;</code> which returns <code>false</code>.</p>
  
  <p>Having complicated query created at runtime I have to use <code>SQLiteDatabase.rawQuery</code>. </p>
  
  <p>How to bind data as <strong>Integer</strong>? </p>
  
  <p>I found one solution:</p>
  
  <pre><code>SELECT CAST( ? AS INTEGER ) &lt; 68 ;
  </code></pre>
  
  <p>but it looks ugly. Is there any other way? I can't find any adequate methods in Android API.</p>