Sha256: 4de598f7704568755d84c0187d9be0e215b0775677af10928721568eee0fe60a

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

.TH Rank
.PP
Tuple ranking
.SH Signature
.PP
.RS
.nf
rank(operand: Relation, order: Ordering, as: AttrName) \-> Relation
.fi
.RE
.SH Examples
.PP
.RS
.nf
rank(suppliers, [:status], :ranking)
.fi
.RE
.PP
.RS
.nf
rank(suppliers, [:status, :sid], :ranking)
.fi
.RE
.SH Description
.PP
Extends tuples from \fB\fCoperand\fR with a new attribute (\fB\fCas\fR) capturing the
tuple position with respect to \fB\fCorder\fR\&.
.PP
The ranking of a tuple \fB\fCt\fR is more precisely defined as the number of tuples
from \fB\fCoperand\fR that would come strictly before \fB\fCt\fR if they were all ordered
according to \fB\fCorder\fR\&. 'Equal' tuples with respect to \fB\fCorder\fR are not counted
in this ranking.
.PP
This means that, unless \fB\fCorder\fR is a total order, duplicate ranking may be
observed. In contrast, if \fB\fCorder\fR covers a candidate key then the ranking
attribute (\fB\fCas\fR) is unique, and therefore defines an additional candidate
key for the resulting relation.
.SH Implementation notes
.PP
Note that this operator does not compile to SQL so far. The \fB\fCpage\fR and
\fB\fCframe\fR operators provide useful alternatives when the aim is to compute
a subset of tuples based on a ranking.

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alf-shell-0.16.3 doc/man/rank.man
alf-shell-0.16.2 doc/man/rank.man
alf-shell-0.16.1 doc/man/rank.man