Home » SQL & PL/SQL » SQL & PL/SQL » SELECTING RANDOM NUMBER & INSERTING INTO ANOTHER TABLE ?
SELECTING RANDOM NUMBER & INSERTING INTO ANOTHER TABLE ? [message #182809] Tue, 18 July 2006 05:08 Go to next message
Khamkhahe
Messages: 12
Registered: June 2006
Location: Islamabad
Junior Member

Hello Dears

Lot of thanks for Cooperation..My problum is solved Using Oracle 9i Database...

Selecting random numbers from table like below:-

SELECT * FROM
( SELECT member_id FROM MEMBERS
ORDER BY dbms_random.VALUE )
WHERE ROWNUM < 126

its display 126 random member_id....

Above selected members_id, How i can insert data into another table ?

Best Regards and Wishes

Miak
Re: SELECTING RANDOM NUMBER & INSERTING INTO ANOTHER TABLE ? [message #182815 is a reply to message #182809] Tue, 18 July 2006 05:23 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Using the same command:
INSERT INTO your_new_table
            (column_name)
   SELECT *
     FROM (SELECT   member_id
               FROM members
           ORDER BY DBMS_RANDOM.VALUE)
    WHERE ROWNUM < 126
Re: SELECTING RANDOM NUMBER & INSERTING INTO ANOTHER TABLE ? [message #186536 is a reply to message #182815] Tue, 08 August 2006 06:50 Go to previous messageGo to next message
Khamkhahe
Messages: 12
Registered: June 2006
Location: Islamabad
Junior Member

Hello Dear

LOt of thanks for ur response...My problum is solved...Lot of thanks....
ALways be happy....
BEST WISHES AND REGARDS

Miak
Re: SELECTING RANDOM NUMBER & INSERTING INTO ANOTHER TABLE ? [message #186537 is a reply to message #182809] Tue, 08 August 2006 06:55 Go to previous message
Khamkhahe
Messages: 12
Registered: June 2006
Location: Islamabad
Junior Member

Hello Dear

Lot of thanks for ur response...My problum is solved...Lot of thanks....

This Forum is very informative and all members, Junior Members & Senior Members are very very co-operative and very helpfull.

Again Lot of thanks for help.. to all

ALways be happy....
BEST WISHES AND REGARDS

Miak
Previous Topic: query
Next Topic: OraOleDBpus.dll not found? Help
Goto Forum:
  


Current Time: Tue Dec 06 06:16:34 CST 2016

Total time taken to generate the page: 0.08531 seconds