title: H2 database - Alternative to Rank() and Row_Num()
body: <p>I am using H2 database in my java application. It seems that it doesn't support <code>rank()</code> and <code>row_num()</code> functions as they are still on their <a href="http://www.h2database.com/html/roadmap.html" rel="nofollow">roadmap list</a></p>
  
  <p>Here's the query that I am trying to execute</p>
  
  <pre><code>select * from (
     select *,
            rank() over(partition by MSISDN order by PORT_IN_DATE desc) rank 
     from TEST_PORTIN
  ) s 
  where rank = 1 
    AND PORT_IN_DATE &gt; '2012-01-16 23:20:27' 
  ORDER BY PORT_IN_DATE
  </code></pre>