This is a migrated thread and some comments may be shown as answers.

Order by null last

1 Answer 25 Views
OQL (OQL specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jacek
Top achievements
Rank 1
Jacek asked on 06 Oct 2014, 07:45 AM
How can I order data descending with null on the end?

In SQL I can do it:
select r
from some_table AS r
order by r.some_column DESC NULLS LAST


In OQL it's not working:
select r
from r.some_tableExtent
order by r.some_column DESC NULLS LAST

What can I do instead?

1 Answer, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 07 Oct 2014, 11:07 AM
At the moment i see no way to express that via OQL. It also seems to be an Oracle specific extension of SQL.
Using LINQ, you could emulate this behavior by using
.OrderBy(x => x.Property != null ? 0 : 1).ThenBy(x => x.Property)


Regards,
Thomas
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
OQL (OQL specific questions)
Asked by
Jacek
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or