Skip to content

Commit 459859a

Browse files
authored
Merge pull request #85 from nebulabroadcast/fix-sorting-by-numeric-with-nulls
Sorting numeric values with nulls
2 parents 719b97e + 8dbf659 commit 459859a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/api/browse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def build_order(order_by: str) -> str:
175175
order_by = f"meta->>'{order_by}'"
176176

177177
if cast_order_by:
178-
order_by = f"CAST({order_by} AS {cast_order_by})"
178+
order_by = f"COALESCE(CAST({order_by} AS {cast_order_by}), 0)"
179179

180180
return order_by
181181

0 commit comments

Comments
 (0)