Combining expressions
Multiple select expressions can be combined using: INTERSECTION, OR, AND, NOT
, and parentheses ( ).
<select expression> intersection <select expression> NOT <select expression> (<select expression>) <select expression> or <select expression> <select expression> and <select expression>
SimpleDB supports both the set operators—INTERSECTION
and UNION
. The INTERSECTION
operator can be used to retrieve items matching the specified predicates on both sides of the operator. The UNION
operator is used for retrieving items that match either of the specified predicates. The UNION
operator works only with the old query syntax and will not work with the new Select syntax. You should use the OR
operator instead of UNION.
INTERSECTION
Retrieve all songs that are released after 1980 and are in the Rock
genre:
SELECT * FROM songs WHERE Year > '1980' INTERSECTION Genre = 'Rock'
SELECT * FROM songs WHERE Year > '1980'
returns:
Item... |
---|