A recordset is a collection of records that you can manipulate and interact with as a group. It represents a set of records in the database that meet certain criteria.
Example of Recordset Combination Operations
The following example demonstrates how recordset combination operations operate:
Suppose we have the following 3 recordsets:
R1 = product.product(1, 2, 3, 4)
R2 = product.product(3, 4, 5, 6)
R3 = product.product(3)
๐คบ ( + )
Extend two recordsets (Duplicate Included)
RecSets = R1 + R2
Result: product.product(1, 2, 3, 4, 3, 4, 5, 6)
๐คบ ( | )
Merge Two recordsets (No duplicate)
RecSets = R1 | R2
Result: product.product(1, 2, 3, 4, 5, 6)
๐คบ ( & )
Find the records that are common between R1 and R2
RecSets = R1 & R2
Result: product.product(3, 4)
๐คบ ( - )
Records in R1 not in R2
RecSets = R1 - R2
Result: product.product(1, 2)
๐คบ ( != )
Check if both contain the same records
R1 != R2
Result: True
๐คบ ( <= )
Check if records in R3 are a subset of R1
R3 <= R1
Result: True
๐คบ ( in )
Check if R3 is part of R1 (R3 Must be one record)
R3 in R1
Result: True
We have more Python operators, such as the ones listed below: ( < , >= , == , not in )