It should be mentioned that I'm working with PostgreSQL. The SQL to perform the trick is probably different depending on which version of PostgreSQL you're using, but these two are certain to work with version 8.3.
I don't know which version support this besides 8.3 select col1, col2, col3 from table order by col1 desc nulls last; This should be supported in earlier version I guess select col1, col2, col3 from table order by case when col1 is null then 1 else 0 end, col1 desc; This might already be implemented, but I just don't know where... On 10 Mar., 16:34, Fabio Maulo <[email protected]> wrote: > which is the SQL ? > > 2009/3/10 TigerShark <[email protected]> > > > > > > > Hi there > > > I have a small question, I hope someone can help me answer. > > > I have a class consisting of several properties, where some are > > nullable DateTime types. > > > When I am sorting by these properties, it does as expected, according > > to the direction of the order, however, when I am sorting ascending, > > the rows with nulls are at top. This is default behavior in most DB's > > I guess, but now to my question. > > > How to I make the rows with nulls stay at the bottom? I have been able > > to do this in pure SQL, but I can't seem to find any way to override > > the default sorting behavior of NHibernate... > > -- > Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" 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/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
