X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 033599FA5D7 for ; Wed, 24 May 2006 07:56:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 58408-01 for ; Wed, 24 May 2006 07:56:42 -0300 (ADT) X-Greylist: delayed 00:20:39.414589 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 53D5B9FA2FA for ; Wed, 24 May 2006 07:56:42 -0300 (ADT) Received: from mobile-elab.com (dsl-53.230-225.indo.net.id [202.53.230.225]) by svr4.postgresql.org (Postfix) with ESMTP id 1E41C5AF071 for ; Wed, 24 May 2006 10:35:49 +0000 (GMT) Received: from andi ([192.168.1.28]) by mobile-elab.com (mobile-elab.com) (MDaemon.PRO.v8.1.3.R) with ESMTP id md50000103055.msg for ; Wed, 24 May 2006 17:33:59 +0700 From: "andi" To: Subject: PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly Date: Wed, 24 May 2006 17:35:10 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000F_01C67F58.686D9720" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcZ/HbvCXDF6v1TMSduwAyt/ex1aQw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-Spam-Processed: mobile-elab.com, Wed, 24 May 2006 17:33:59 +0700 (not processed: message from valid local sender) X-MDRemoteIP: 192.168.1.28 X-Return-Path: andi@mobile-elab.com X-MDaemon-Deliver-To: pgsql-sql@postgresql.org Message-Id: <20060524103549.1E41C5AF071@svr4.postgresql.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.25 tagged_above=0 required=5 tests=BAYES_50, FORGED_RCVD_HELO, HTML_90_100, HTML_MESSAGE, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200605/182 X-Sequence-Number: 25213 This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C67F58.686D9720 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Dear friends, I have table MD_CUSTOMER MD_CUSTOMERIDPK integer primary key NAME varchar But my primary key is not in correct order like MD_CUSTOMER MD_CUSTOMERIDPK NAME 10 ANDI 33 TESTER 100 KKK , so I want to make other primary key to generate sequences 1, 2, 3, . and in MS SQL SERVER 2005 I can with Rank() function , but in Postgres how ? PLEASE any one can help me, I am really appreciate. Best regards Andi kusnadi ------=_NextPart_000_000F_01C67F58.686D9720 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Dear friends,

 

I have table

MD_CUSTOMER

MD_CUSTOMERIDPK integer primary key

NAME     &nb= sp;           &nbs= p;         = varchar

 

 

But my primary key is not in correct order = like

MD_CUSTOMER<= /b>

MD_CUSTOMERIDPK        &n= bsp;            = NAME

10           = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =             &= nbsp;   ANDI

33           = ;            =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =             &= nbsp;   TESTER

100       &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;    KKK

 

, so I want to make other primary key to generate sequences 1, = 2, 3, … and in MS SQL SERVER 2005

I can with Rank() function , but in Postgres how = ?

 

PLEASE any one can help me, I am really = appreciate.

 

Best regards

 

Andi kusnadi

------=_NextPart_000_000F_01C67F58.686D9720--