title: sqlite select AS behavior
body: <p>I got a little problem with the AS in a select statement, it kinda change the type of my column from INTEGER to TEXT. </p>
  
  <pre><code>sqlite&gt; drop table t;
  sqlite&gt; create table t (x integer);
  sqlite&gt; insert into t values (0);
  sqlite&gt; insert into t values (1);
  sqlite&gt; insert into t values (2);
  sqlite&gt; insert into t values (3);
  sqlite&gt; insert into t values (1010);
  sqlite&gt;
  sqlite&gt; .mode column t
  sqlite&gt; .headers on
  sqlite&gt; select printf('%d',x) from t order by x desc;
  printf('%d',x)
  --------------
  1010
  3
  2
  1
  0
  </code></pre>
  
  <p>The sort is OK now renaming the Col to get a better header.</p>
  
  <pre><code>sqlite&gt; select printf('%d',x) as x from t order by x desc;
  x
  ----------
  3
  2
  1010
  1
  0
  </code></pre>
  
  <p>The sort is no good anymore, like if doing AS make nx become a TEXT ?</p>
  
  <p>Quoting don't help</p>
  
  <pre><code>sqlite&gt; select printf('%d',x) as 'x' from t order by x desc;
  x
  ----------
  3
  2
  1010
  1
  0
  </code></pre>
  
  <p>Unless you stick something in the AS like this</p>
  
  <pre><code>sqlite&gt; select printf('%d',x) as 'x ' from t order by x desc;
  x
  ----------
  1010
  3
  2
  1
  0
  </code></pre>
  
  <p>Is that the expected behavior ?</p>
  
  <p>Thanx for any advises
  Cheers,
  Phi</p>