Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL question: automatically number rows returned by query

Re: SQL question: automatically number rows returned by query

From: TurkBear <johng_at_mm.com>
Date: Wed, 15 Dec 1999 18:20:53 GMT
Message-ID: <3858dbc4.10219895@super.news-ituk.to>

Select rownum row# ,col_1,col_2
from my_table
where col_1 = 'X';

toddowers_at_my-deja.com wrote:

>Is it possible to automatically number the rows
>returned by a query?
>
>For example, suppose the following query returns
>3 rows:
>
>SELECT col_1, col_2
>FROM my_table
>WHERE col_1 = 'X';
>
>I would like to see the following result:
>
>row# col_1 col_2
>---- ----- -----
>1 X A
>2 X B
>3 X C
>
>In other words, I would like to automatically
>generate the row# column. Any thoughts?
>
>Thanks in advance for your help.
>
>Todd Owers
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------    http://www.newsfeeds.com The Largest Usenet Servers in the World! ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==----- Received on Wed Dec 15 1999 - 12:20:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US