Re: DB2 to Postgresql conversion help.

From: Joe Conway <mail(at)joeconway(dot)com>
To: John Pauley <karstdiver(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: DB2 to Postgresql conversion help.
Date: 2002-12-23 17:13:45
Message-ID: 3E074449.9060608@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jason Pyeron 2002-12-24 00:12:06 corresponding primary key for max(column)?
Previous Message John Pauley 2002-12-23 16:32:01 DB2 to Postgresql conversion help.