That query looks like it is trying to implement the 'nulls first' order by parameter. Maybe you can make Mondrian use that style?
On Tuesday, 14 August 2012, Mike Goodwin wrote: > Hi Thomas, > > I understand that it is possible to rewrite the query to make it work. The > issue is that it is a generated query by Mondrian (it doesn't say that it > supports h2) so rewriting the query is not a trivial step. Since h2 is not > an officially supported dialect so it may be that I need to play around > with the compatability settings of Mondrian, of course this may also not > work. (I will report back when I try to do this, not sure when this will be > though) > > Regards, > > Mike > > On Mon, Aug 6, 2012 at 7:42 AM, Thomas Mueller < > [email protected] <javascript:_e({}, 'cvml', > '[email protected]');>> wrote: > >> Hi, >> >> What you could do is: >> >> SELECT >> YEAR(date) as year >> FROM x >> GROUP BY >> CASE WHEN YEAR(date) IS NULL THEN 1 ELSE 0 END, >> YEAR(date) >> ORDER BY >> CASE WHEN YEAR(date) IS NULL THEN 1 ELSE 0 END, >> YEAR(date) ASC; >> >> Regards, >> Thomas >> >> -- >> 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]<javascript:_e({}, 'cvml', >> '[email protected]');> >> . >> To unsubscribe from this group, send email to >> [email protected] <javascript:_e({}, 'cvml', >> 'h2-database%[email protected]');>. >> For more options, visit this group at >> http://groups.google.com/group/h2-database?hl=en. >> > > -- > 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]<javascript:_e({}, 'cvml', > '[email protected]');> > . > To unsubscribe from this group, send email to > [email protected] <javascript:_e({}, 'cvml', > 'h2-database%[email protected]');>. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > -- 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.
