Rami, well, I thought you wanted a scipt that reproduces a test case. That is what it does!
The CAST part is very interesting, I learned something here :-) As I stated before, this is what I am looking for and what the query I came up with in my last post delivers: ANLDETAIL_WKN VORLETZTER_DATUM LETZTER_DATUM 620200 2012-05-31 2012-06-01 855018 2012-05-30 2012-06-01 So I am trying to get VORLETZTER_DATUM , LETZTER_DATUM for every ANLDETAIL_WKN in the same recordset! I was referring to ANLDETAIL_WKN as the ID I am sorry for the cofusion. The output of your query is: ANLDETAIL_WKN DATUM DATUM 620200 2012-06-01 2012-05-31 I ran your query against my database the table ANLKURSE contains about 200.000 records and 200 different ANLDETAIL_WKN The query took about 1.50 min the one I provided less than a second. As I said before ANLKURSE contains more columns than provided in this example. And also when I JOIN more Tables my query is getting a bit complicated even though it runs fine. That is why I would prefer a 'clean' query like the one you provided and the one I posted in my first post that used to do the job up to h2 version 1.3.165 -- possibly due to issue 387: WHERE condition getting pushed into sub-query with LIMIT so it should not have worked in the first place. Anyway, thanks Rami for taking the time -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
