Home » SQL & PL/SQL » SQL & PL/SQL » Creating a temp table and unique numbering
Creating a temp table and unique numbering [message #39650] Wed, 31 July 2002 02:54 Go to next message
Bryan Avery
Messages: 4
Registered: July 2002
Junior Member
I have a table which has two fields as the primary key, and these fields are alpha fields.

What I need to do is create a temp. table and create a unique number following the primary key.

The table currently looks like this:

CATEGORY SEWER
CATEGORY WATERPE
CATEGORY WATERPVC
DIVISION BELOWGR
DIVISION BUILDING
DIVISION LITRTURE
DIVISION UTILITY

and I would like to have a table looking like this:

11 CATEGORY SEWER
8 CATEGORY WATERPE
9 CATEGORY WATERPVC
4 DIVISION BELOWGR
1 DIVISION BUILDING
2 DIVISION LITRTURE
3 DIVISION UTILITY

Sounds quite simple, any ideas?
Re: Creating a temp table and unique numbering [message #39658 is a reply to message #39650] Wed, 31 July 2002 08:31 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
create table t
  (num, pk1, pk2)
as
  select rownum, pk1, pk2
    from original_table;
Previous Topic: error when I send email from a stored procedure
Next Topic: singly sql query Please reply immediately
Goto Forum:
  


Current Time: Thu Apr 25 20:18:29 CDT 2024