Sha256: dfd0d24481ce2d024e5d321df9da16a9d720a2598707209be0fe182e6d39fcbb

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

.TH Not_matching
.PP
Aka 'where not exists'
.SH Signature
.PP
.RS
.nf
not_matching(left: Relation, right: Relation) -> Relation
.fi
.RE
.SH Examples
.PP
.RS
.nf
not_matching(suppliers, supplies)
.fi
.RE
.SH Description
.PP
Computes a relation as a subset of \fB\fCleft\fR tuples for which no tuple from
\fB\fCright\fR would join on common attributes.
.PP
This operator is the inverse of \fB\fCmatching\fR, as shown by the definition
below. It keeps all tuples from \fB\fCleft\fR but those that match a tuple from
\fB\fCright\fR\&.
.PP
.RS
.nf
def not_matching(left, right)
  minus(left, matching(left, right))
end
not_matching(suppliers, supplies)
.fi
.RE
.PP
The synonym 'where not exists' comes from the fact that, since right
attributes do not appear in the result, it may seem more intuitive to think
about this operator as filtering tuples from left where \fIthere does not
exist\fP any tuple from right that \fIwould\fP join. In SQL terms:
.PP
.RS
.nf
SELECT * FROM left WHERE NOT EXISTS (SELECT * FROM right WHERE [join condition])
.fi
.RE
.SH Implementation notes
.PP
As for join and matching, you must take care of ensuring that the list of
common attributes on which the (not) matching applies corresponds to what
you want. Renamings and projections are worth having at hand.
Alternatively, shortcuts can be considered (see \fB\fCmatching\fR and \fB\fCjoin\fR).

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alf-shell-0.16.4 doc/man/not_matching.man
alf-shell-0.16.0 doc/man/not_matching.man
alf-shell-0.15.0 doc/man/not_matching.man