Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determinstic ordering using a second column if the value of the first is null #389

Open
tbrammar opened this issue Nov 30, 2021 · 0 comments

Comments

@tbrammar
Copy link
Contributor

Is it possible to use deterministic ordering, but supply two columns and if the value for the first is null take the second value?

For instance, to achieve this in Rails I'd normally write something like order(Arel.sql("COALESCE(column_1, column_2) ASC")). Is functionality like this achievable with Closure Tree?

@tbrammar tbrammar changed the title determinstic ordering using a second column if the value of the first is null Determinstic ordering using a second column if the value of the first is null Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant