rank function

Expr<int> rank({
  1. List<Expr<Object?>> partitionBy = const [],
  2. required List<OrderTerm> orderBy,
})

Builds one-based SQL rank, with ties sharing a rank and leaving later gaps.

Partition and ordering expressions belong to the surrounding query scope.

Implementation

Expr<int> rank({
  List<Expr<Object?>> partitionBy = const [],
  required List<OrderTerm> orderBy,
}) => Expr.internal(
  WindowNode(
    FunctionNode('RANK', const []),
    List.unmodifiable(partitionBy),
    List.unmodifiable(orderBy),
    null,
  ),
  Codecs.integer,
);