Skip site navigation (1) Skip section navigation (2)

returned row number

From: "Keith Worthington" <keithw(at)narrowpathinc(dot)com>
To: "PostgreSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: returned row number
Date: 2005-05-06 19:45:02
Message-ID: 20050506193743.M20879@narrowpathinc.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi All,

I have a quick question.  Is there a simple way to access the returned record
number?

I want to be able to do something like

SELECT record AS record_no,
       column1,
       column2
  FROM table1
 WHERE column2 < 100
 ORDER BY column1;

record_no | column1 | column2
----------+---------+---------
1         | A       | 1.75
2         | F       | 93
3         | M       | 12.5
4         | N       | 0
5         | Q       | 57.6

Kind Regards,
Keith

Responses

pgsql-novice by date

Next:From: Bruno Wolff IIIDate: 2005-05-06 21:00:16
Subject: Re: returned row number
Previous:From: Bruno Wolff IIIDate: 2005-05-06 16:02:28
Subject: Re: Execute function without execute privilege

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group