Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a1c68b4

Browse files
committed
A patch for the GROUP BY/HAVING example. p.date should be s.date.
Robert B. Easter
1 parent 58f882d commit a1c68b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/src/sgml/queries.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/queries.sgml,v 1.1 2001/01/22 23:34:33 petere Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/queries.sgml,v 1.2 2001/02/01 19:13:47 momjian Exp $ -->
22

33
<chapter id="queries">
44
<title>Queries</title>
@@ -531,7 +531,7 @@ SELECT pid AS "Products",
531531
p.name AS "Over 5000",
532532
(sum(s.units) * (p.price - p.cost)) AS "Past Month Profit"
533533
FROM products p LEFT JOIN sales s USING ( pid )
534-
WHERE p.date > CURRENT_DATE - INTERVAL '4 weeks'
534+
WHERE s.date > CURRENT_DATE - INTERVAL '4 weeks'
535535
GROUP BY pid, p.name, p.price, p.cost
536536
HAVING p.price > 5000;
537537
</programlisting>

0 commit comments

Comments
 (0)