title: Wired sql query
body: <pre><code>sqlite&gt; select sid,max(amount) from(select * from Am where year=2014);
  1,600
  sqlite&gt; select sid from (select sid,max(amount) from(select * from Am where year=2014));
  3
  </code></pre>
  
  <p>Where 3 come from?! the only option is 1..
  Whats going on?
  Thanks.</p>