Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORDER BY ASC and DESC nulls order using EF Core

4263965Jun 17 2020 — edited Jun 22 2020

I'm comparing OrderBy results using Oracle.EFCore 3.19.0-beta1 and Sqlite 3.1.4 and found one difference.

With Oracle the OrderByDescending creates a query

SELECT "m"."ID", "m"."CATEGORY", "m"."CODE" FROM "MY_DB"."MATERIAL" "m" ORDER BY "m"."CATEGORY" 

this means that the first rows will have NULL on category column, if any.

Using Sqlite the query is almost identical but the NULL will be in the last rows.

This behavior is intentional?

The Oracle OrderBy gerenates this query:

SELECT "m"."ID", "m"."CATEGORY", "m"."CODE" FROM "MY_DB"."MATERIAL" "m" ORDER BY "m"."SOS" NULLS FIRST

OrderByDescending shouldn't have a NULLS LAST?

This post has been answered by Alex Keh-Oracle on Jun 22 2020
Jump to Answer

Comments

Processing

Post Details

Added on Jun 17 2020
5 comments
1,998 views