MySQL Forums
Forum List  »  Oracle

Re: rownum-Problem - the solution
Posted by: solleon menezes
Date: June 28, 2006 04:39PM

Replace yourquery for the query thats you needs.

SELECT @rownum:=@rownum+1 rownum, t.*FROM (SELECT @rownum:=0) r, ("yourquery") t;

and the first column will be named 'rownum' with the number of current row.

example.:
SELECT @rownum:=@rownum+1 rownum, t.*FROM (SELECT @rownum:=0) r, ("select name from client") t;

so the result you be the resultset:
| rownum | name |
| 1 | mark |
| 2 | tommy |

:) anything mail-me.

Options: Reply• Quote


Subject
Views
Written By
Posted
18407
August 06, 2004 12:28AM
28669
September 26, 2004 09:04AM
12299
October 09, 2004 03:02PM
22944
October 10, 2004 12:56PM
12775
December 22, 2004 07:05AM
13806
December 22, 2004 01:59PM
9930
April 13, 2005 01:25PM
13261
April 14, 2005 12:08AM
7335
April 26, 2005 02:12AM
7925
April 20, 2005 04:37PM
10320
April 23, 2005 09:48AM
5890
August 26, 2008 03:47AM
6097
April 26, 2005 02:16AM
5882
October 18, 2005 02:57PM
5868
November 16, 2005 04:58PM
Re: rownum-Problem - the solution
19001
June 28, 2006 04:39PM
19410
August 08, 2006 07:45AM
5568
December 14, 2008 10:01PM
5734
February 05, 2009 04:49PM
4921
December 27, 2008 03:27AM
5077
December 27, 2008 04:19AM
6779
February 08, 2007 02:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.