Re: DB2 to Postgresql conversion help. - Mailing list pgsql-sql

From Joe Conway
Subject Re: DB2 to Postgresql conversion help.
Date
Msg-id 3E074449.9060608@joeconway.com
Whole thread Raw
In response to DB2 to Postgresql conversion help.  (John Pauley <karstdiver@yahoo.com>)
List 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



pgsql-sql by date:

Previous
From: John Pauley
Date:
Subject: DB2 to Postgresql conversion help.
Next
From: Jason Pyeron
Date:
Subject: corresponding primary key for max(column)?