[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-admin
Subject: Re: [ADMIN] windown function count Unexpected results
From: winston cheung <winston_cheung () 163 ! com>
Date: 2017-05-05 11:10:04
Message-ID: 13010b9e-7d51-c17a-1202-7cc084df7d9e () 163 ! com
[Download RAW message or body]
thanks a lotï¼stevenï¼david :-)
å¨ 5/5/17 13:14, Steven Chang åé:
> Hello,
>
> Official document in
> https://www.postgresql.org/docs/9.3/static/functions-window.html says
> so :
> An aggregate used with ORDER BY and the default window frame
> definition produces a "running sum" type of behavior, which may or may
> not be what's wanted. To obtain aggregation over the whole partition,
> omit ORDER BY or use ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED
> FOLLOWING
winston , regards
[Attachment #3 (text/html)]
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>thanks a lot,steven,david :-)<br>
</p>
<br>
<div class="moz-cite-prefix">在 5/5/17 13:14, Steven Chang 写道:<br>
</div>
<blockquote
cite="mid:CAEJt7k2S611CXKkcW-CiVkA-kyjtABtjNYqHD3ZM9b5koXYDRg@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div> Official document in <a moz-do-not-send="true"
href="https://www.postgresql.org/docs/9.3/static/functions-window.html">https://www.postgresql.org/docs/9.3/static/functions-window.html</a> \
says so :</div>
<div><span
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:medium">An
aggregate used with </span><tt class="gmail-LITERAL"
style="color:rgb(0,0,0)">ORDER BY</tt><span
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:medium"> \
and the default window frame definition produces a </span><span
class="gmail-QUOTE"
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:medium">"running
sum"</span><span
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:medium"> \
type of behavior, which may or may not be what's wanted. To
obtain aggregation over the whole partition, omit </span><tt
class="gmail-LITERAL" style="color:rgb(0,0,0)">ORDER BY</tt><span
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:medium"> or
use </span><tt class="gmail-LITERAL"
style="color:rgb(0,0,0)">ROWS BETWEEN UNBOUNDED PRECEDING
AND UNBOUNDED FOLLOWING</tt></div>
</div>
</blockquote>
<br>
winston , regards<br>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic