Oracle-Use ROWNUM To Return Row Count

Oracle ROWNUM Reserved Field

Use reserved field, ROWNUM in SELECT Statement to return record number in the data output:

SELECT ROWNUM, FIELD1, FIELD2, FIELD3 FROM YOUR_TABLE

Returns:

ROWNUM	        FIELD1		FIELD2		FIELD3
1		F1VAL1		F2VAL1		F3VAL1
2		F1VAL2		F2VAL2		F3VAL2
3		F1VAL3		F2VAL3		F3VAL3
4		F1VAL4		F2VAL4		F3VAL4
5		F1VAL5		F2VAL5		F3VAL4
Advertisements
About

Over 20 years programming experience 5 years Oracle SQL/Stored Procedure programming Over 10 years SQL 2000/2005/2008 Server SQL/Stored Procedure programming Over 18 years Visual Basic 3.0/4.0/5.0/6.0/.Net/2003/2005/2008/2010/2015 Over 10 years ASP.Net Over 7 years Visual C# Over 20 years Microsoft Office and VBA HTML JAVA COBOL EASYTRIEVE FORTRAN

Tagged with: , ,
Posted in Oracle

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: