Skip to content

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

Description

@tbrammar

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions