Intersect

Finds tuples common to two relations.

Usage

intersect (lhs, rhs : intersected-data)

Details

Returns all tuples from the set that represents the intersection of lhs and rhs.

Notes

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
      ----------------------------------------------
      Title4|Author3|01-01-1968|32
      Title3|Author2|05-09-2002|733
      ----------------------------------------------