Minus
Subtracts one relation from another.
Usage
minus (lhs, rhs : minused-data)
Details
Returns all tuples from the set that represents the
subtraction of lhs and rhs.
Notes
- If relations do not have the same schemas, errors will occur.
- By definition, sets are composed of unique elements - thus,
duplicates will not be returned.
Known Bugs
Example
Using the input:
RELATION books1: title char, author char, pub_date date, pages number
Title1|Author1|09-01-1991|34
Title2|Author2|12-23-1954|479
Title3|Author2|05-09-2002|733
Title4|Author3|01-01-1968|32
Title5|Author2|07-03-2001|1152
RELATION books2: title char, author char, pub_date date, pages number
Title3|Author2|05-09-2002|733
Title4|Author3|01-01-1968|32
Title6|Author4|03-14-1977|168
Title7|Author4|07-23-1999|332
when executing the plan:
PLAN test
{
INPUT: stream books1, stream books2
OUTPUT: stream answer
BODY
{
minus (books1, books2 : answer)
}
}
will generate the following output:
----------------------------------------------
RELATION: test_answer
attrs: title, author, pub_date, pages
----------------------------------------------
Title2|Author2|12-23-1954|479
Title1|Author1|09-01-1991|34
Title5|Author2|07-03-2001|1152
----------------------------------------------