[SQL] corresponding primary key for max(column)?

2002-12-23 Thread Jason Pyeron
is there a better way? for reasons not defined by me, i cannot constrain the data in the locations table with unique(ref,ts) that said Microsoft mappoint craps out if there are duplicate values in the ref column. so i need to create a view which returns locations.* for the row which contains

Re: [SQL] DB2 to Postgresql conversion help.

2002-12-23 Thread Joe Conway
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

[SQL] DB2 to Postgresql conversion help.

2002-12-23 Thread John Pauley
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 TIA, Happy Holid

Re: [SQL] save data from views

2002-12-23 Thread [EMAIL PROTECTED]
On Mon, 23 Dec 2002, [iso-8859-1] [EMAIL PROTECTED] wrote: > > > > first of all, thanx for anyone who answered my previous question... i've understood >what was wrong... > now, i've got another question, i know it could sound stupid, but i have not such a >great practice with postgres. i'

Re: [SQL] save data from views

2002-12-23 Thread Achilleus Mantzios
On Mon, 23 Dec 2002, [iso-8859-1] [EMAIL PROTECTED] wrote: > > > > first of all, thanx for anyone who answered my previous question... i've understood >what was wrong... > now, i've got another question, i know it could sound stupid, but i have not such a >great practice with postgres. i'm aski

[SQL] save data from views

2002-12-23 Thread [EMAIL PROTECTED]
first of all, thanx for anyone who answered my previous question... i've understood what was wrong... now, i've got another question, i know it could sound stupid, but i have not such a great practice with postgres. i'm asking you: is it that a way to save values from a view? i'm