pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Jeff Turner <jeff@biccard.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #5841: rank()+1 fails, 1+rank() succeeds
Date: Mon, 17 Jan 2011 12:10:19 -0300
Message-ID: <1295276957-sup-5631@alvh.no-ip.org> (raw)
In-Reply-To: <201101171034.p0HAYTE7056475@wwwmaster.postgresql.org>
References: <201101171034.p0HAYTE7056475@wwwmaster.postgresql.org>

Excerpts from Jeff Turner's message of lun ene 17 07:34:29 -0300 2011:

> test=# select *, rank()+1 over (partition by bar) from t;
> ERROR:  syntax error at or near "over"
> LINE 1: select *, rank()+1 over (partition by bar) from t;

The "over" stuff is part of the expression; you can't add the +1 in the
middle.  This works:

select *, rank() over (partition by bar) + 1 from t;

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (4+ messages)  latest in thread

Message-ID: <1295276957-sup-5631@alvh.no-ip.org>
Permalink:  ../1295276957-sup-5631@alvh.no-ip.org/
Also on:    postgresql.org/message-id/1295276957-sup-5631@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@commandprompt.com, jeff@biccard.com
  Subject: Re: BUG #5841: rank()+1 fails, 1+rank() succeeds
  In-Reply-To: <1295276957-sup-5631@alvh.no-ip.org>
  References: <201101171034.p0HAYTE7056475@wwwmaster.postgresql.org> <1295276957-sup-5631@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox