Skip to content

Commit b0a40a5

Browse files
committed
fix discount
1 parent e320a9a commit b0a40a5

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

modules/ROOT/pages/queries/composed-queries/sequential-queries.adoc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ RETURN c, p
198198
199199
NEXT
200200
201-
RETURN c.firstName AS name, COLLECT(p.price * c.discount) AS purchases, "discounted price" AS type
201+
RETURN c.firstName AS name, COLLECT(p.price * (1 - c.discount)) AS purchases, "discounted price" AS type
202202
UNION
203203
RETURN c.firstName AS name, COLLECT(p.price) AS purchases, "real price" AS type
204204
@@ -213,20 +213,20 @@ RETURN * ORDER BY name, type
213213
|===
214214
| name | purchases | type
215215

216-
| "Amir" | [100.0, 0.5] | discounted price
217-
| "Amir" | [1000, 5] | real price
218-
| "Hannah" | [37.5, 1.5] | discounted price
219-
| "Hannah" | [250, 10] | real price
220-
| "Keisha" | [50.0] | discounted price
221-
| "Keisha" | [250] | real price
222-
| "Leila" | [100.0] | discounted price
223-
| "Leila" | [1000] | real price
224-
| "Mateo" | [50.0, 0.25, 0.5] | discounted price
225-
| "Mateo" | [1000, 5, 10] | real price
226-
| "Niko" | [125.0, 62.5, 2.5] | discounted price
227-
| "Niko" | [500, 250, 10] | real price
228-
| "Yusuf" | [100.0, 0.5] | discounted price
229-
| "Yusuf" | [1000, 5] | real price
216+
| "Amir" | [900.0, 4.5] | discounted price
217+
| "Amir" | [1000, 5] | real price
218+
| "Hannah" | [212.5, 8.5] | discounted price
219+
| "Hannah" | [250, 10] | real price
220+
| "Keisha" | [200.0] | discounted price
221+
| "Keisha" | [250] | real price
222+
| "Leila" | [900.0] | discounted price
223+
| "Leila" | [1000] | real price
224+
| "Mateo" | [950.0, 4.75, 9.5] | discounted price
225+
| "Mateo" | [1000, 5, 10] | real price
226+
| "Niko" | [375.0, 187.5, 7.5] | discounted price
227+
| "Niko" | [500, 250, 10] | real price
228+
| "Yusuf" | [900.0, 4.5] | discounted price
229+
| "Yusuf" | [1000, 5] | real price
230230

231231
3+d|Rows: 14
232232
|===

0 commit comments

Comments
 (0)