pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: John Pauley <karstdiver@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: DB2 to Postgresql conversion help.
Date: Mon, 23 Dec 2002 09:13:45 -0800
Message-ID: <3E074449.9060608@joeconway.com> (raw)
In-Reply-To: <20021223163201.37261.qmail@web13406.mail.yahoo.com>
References: <20021223163201.37261.qmail@web13406.mail.yahoo.com>

John Pauley wrote:
> All,  Any suggestions on a Postgresql equivalent to
> the following DB2 sql query:
> 
> SELECT * FROM (SELECT
> ID,NAME,CITY,STATE,PROGRAM,CUST_NAME,CUST_ID,ROWNUMBER()
> OVER (ORDER BY ID ASC) AS RN FROM
> MERCHANT_BROWSER_VIEW WHERE CUST_ID = 'A51B8CA2' ) AS
> RESULT WHERE RN BETWEEN 1 AND 20
> 

I'm not familiar with DB2, but I'd guess something like:

   SELECT ID,NAME,CITY,STATE,PROGRAM,CUST_NAME,CUST_ID
   FROM MERCHANT_BROWSER_VIEW
   WHERE CUST_ID = 'A51B8CA2'
   ORDER BY ID
   LIMIT 20;

HTH,

Joe




view thread (2+ messages)

Message-ID: <3E074449.9060608@joeconway.com>
Permalink:  ../3E074449.9060608@joeconway.com/
Also on:    postgresql.org/message-id/3E074449.9060608@joeconway.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mail@joeconway.com, karstdiver@yahoo.com
  Subject: Re: DB2 to Postgresql conversion help.
  In-Reply-To: <3E074449.9060608@joeconway.com>

* 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