wrap(a, {attr_list}, wrap_name)
A relation operator.
Adds a new nested tuple, named wrap_name, containing each attr in the attr list moved down from a.
Examples
wrap
wrap($S, {SNO, SNAME, CITY}, sups)
| STATUS | sups |
|---|---|
| 10 |
|
| 20 |
|
| 20 |
|
| 30 |
|
| 30 |
|
wrap with inverted attr_list
wrap($S, ~{STATUS}, sups)
| STATUS | sups |
|---|---|
| 10 |
|
| 20 |
|
| 20 |
|
| 30 |
|
| 30 |
|
Note: this version gives the same results as above but behaves as expected if new attributes are added to the relation (and perhaps reads more easily).