Skip to content

Commit 4079d91

Browse files
committed
Doc: fix example of recursive query.
Compute total number of sub-parts correctly, per jason@banfelder.net Simon Riggs Discussion: https://postgr.es/m/166161184718.1235920.6304070286124217754@wrigleys.postgresql.org
1 parent 3f7323c commit 4079d91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/src/sgml/queries.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2133,7 +2133,7 @@ SELECT sum(n) FROM t;
21332133
WITH RECURSIVE included_parts(sub_part, part, quantity) AS (
21342134
SELECT sub_part, part, quantity FROM parts WHERE part = 'our_product'
21352135
UNION ALL
2136-
SELECT p.sub_part, p.part, p.quantity
2136+
SELECT p.sub_part, p.part, p.quantity * pr.quantity
21372137
FROM included_parts pr, parts p
21382138
WHERE p.part = pr.sub_part
21392139
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy