From b3e211ffe224e18d0b29000bab93954c727e26e1 Mon Sep 17 00:00:00 2001 From: Slava Date: Sat, 22 Jan 2022 00:21:14 +0200 Subject: [PATCH] changed answer of question #2 current answer result: edgedb> SELECT (Person.name, find(Person.name, 'ma')); {('Lucy', -1), ('Count Dracula', -1), ('Crewman 1', 4)} new answer result: edgedb> with x := (select (Person.name, find(Person.name, 'ma'))) select x.0 filter x.1 > -1; {'Crewman 1'} --- chapter16/answers.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chapter16/answers.md b/chapter16/answers.md index 247cd5c7..6c617d89 100644 --- a/chapter16/answers.md +++ b/chapter16/answers.md @@ -14,7 +14,8 @@ SELECT two_names FILTER len(two_names) = 2; The query is quite short: ```edgeql -SELECT (Person.name, find(Person.name, 'ma')); +with names := (select (Person.name, find(Person.name, 'ma'))) +select names.0 filter names.1 != -1; ``` Note that the first `Person.name` and the second `Person.name` are the same, which is why no Cartesian multiplication is used. However, if you changed the second one to `DETACHED Person.name` it would, and you would get well over 100 results.