| It is possible to name sets of objects. |
|
SELECT name FROM ( SELECT manufacturer FROM vehicle WHERE color = 'blue' ); |
SELECT count(f) FROM f IN company
WHERE president IN (
SELECT a FROM a IN employee WHERE salary > 200000 );
|
SELECT f.subsidiaries.employees.salary FROM f IN company; |
employees to the result of f.subsidiaries, because the latter is a set, employees is defined only for single subsidiaries.
Two solutions are
flatten operator.
flatten( SELECT flatten( flatten(f.subsidiaries).emplyees).salary FROM f IN company); |
|
Waiter: Can I take your order sir, kids eat free today. Me: Oh, well in that case I’ll just have a glass of water and my son will have the grilled lobster, a 15oz steak and a small bottle of champagne please. |