Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increment Collumn

Status
Not open for further replies.

ofsouto

Programmer
Joined
Apr 29, 2000
Messages
185
Location
BR
I want to show all registers from a table(CODE, DESCRIPTION) and show an additional collum with the row number(INCREMENT).

Select * from table_1

RESULT:
CODE DESCTIPTION INCREMENT
-------- ------------------------- -----------
03354718 FIRST_DESCRIPTION 1
54654654 SECOND_DESCRIPTION 2
62173620 THIRD_DESCRIPTION 3

How can I get it?
Thank you very much
 
You'll need to add a column to the table with the INT data type. Then set this column to be an identity column.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(Not quite so old any more.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top