Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A96EC9FB639 for ; Tue, 15 May 2007 10:36:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 29459-03 for ; Tue, 15 May 2007 10:36:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 171C49FB5DC for ; Tue, 15 May 2007 10:36:28 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1HnxCV-0008Cp-QP for pgsql-sql@postgresql.org; Tue, 15 May 2007 09:36:27 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 66FFA3F9E; Tue, 15 May 2007 09:36:22 -0400 (EDT) Date: Tue, 15 May 2007 09:36:22 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Serial number of a record Message-ID: <20070515133622.GB631@phlogiston.dyndns.org> References: <380-220075215114025163@M2W015.mail2web.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <380-220075215114025163@M2W015.mail2web.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/131 X-Sequence-Number: 28411 On Tue, May 15, 2007 at 07:40:25AM -0400, ashok@kalculate.com wrote: > Suppose if i will fire a query "select Name from tablename where age=30". > it will give output "shyam" but i also want record no. other then oid, in > this case it is 3. > > is it possible? > if yes then how? > plz. help me. This depends. Does the record have a serialno field? If not, you can do it with a temporary sequence. But you should be aware that this "serial number" as you call it changes from result to result in that case. A -- Andrew Sullivan | ajs@crankycanuck.ca The whole tendency of modern prose is away from concreteness. --George Orwell