How can I select random records from one column

How can I random select 400 records from a column contains more than 500,000 records? And how long will it take in oracle? Thanks.

here is one option: (just change 5 to suit your needs...)
SQL>select * from (
  2  select object_name
  3  from all_objects
  4  order by dbms_random.random
  5  ) where rownum < 5
  6  /
OBJECT_NAME
UTL_SYS_COMPRESS
GV_$LOG_HISTORY
GV_$LOGMNR_LOGS
WWV_FLOW_THEME_7
SQL>/
OBJECT_NAME
WWV_FLOW_UPGRADE_REPORT
WRI$_ADV_SQLT_STATISTICS_PK
V_$DATABASE
GV_$SERVICEMETRIC
SQL>/
OBJECT_NAME
WWV_FLOW_CREATE_FLOW_API
WRH$_SERVICE_WAIT_CLASS_BL
EXU8SNAPL
GV$SERVICEMETRIC_HISTORY
SQL>                well, regarding how long will it take... it depends from lots of variables...
Cheers,
Andrea

Similar Messages

  • How can we select duplicate records from a table

    Hi
    I desire to use a query to select duplicate columns (based on all the columns of the table) ...
    I am able to write queries which include column names, but when my table contains more than 50 columns, is it advisable for me to mention all the 50 column names in the query or is there any other query by which duplicate rows can be selected without column names being mentioned ?
    Thnx in advance
    Regards

    Basic rule of relational design says that "thy table shalt have a primary key".
    Now assuming that you do not have a primary key constraint and that resulted in duplicates, you should still have a couple of columns that uniquely describes a row in that table.
    To select duplicate rows can then be done by joining rows with the primary key (same set of unique columns), where rows have different rowids (physical addresses).
    E.g.
    select
    t1.*,
    t2.*
    from table t1,
    table t2
    where t1.col1 = t2.col1
    and t1.col2 = t2.col2
    and t1.rowid < t2.rowidIf you do not have a couple of columns (primary key) that uniquely identifies a row, then you do not have duplicates in the table - as there cannot be duplicates without having a means of unique identification.

  • How can I place two fields from one column side by side?

    Hello experts,
       I need your help: I have a column which has two different fields. One is Sales, the second is Sales Todate.
    My boss want me to get the difference btn them as well as the percentage. Now, here is my challenge: I can easily filter them but I want them to be side by side; but when I filter one appear on top of the other like below
    Sales                           
    Sales
    Sales
    Sales
    Sales
    SalesTodate
    SalesTodate
    SalesTodate
    SalesTodate
    SalesTodate
    However, I want them appearing like below:    that way, I can place the difference column beside them.
    Sales
    SalesTodate
    Sales
    SalesTodate
    Sales
    SalesTodate
    Sales
    SalesTodate
    Sales
    SalesTodate
    Any help will be appreciated..  I have tried a case statement, still the problem persist
    Chuck
    On the side: Does anyone know how to place the question in such a way when one answers I can mark correct or helpful, I am still not able to.. I hate it, when I place a question I go through create then discussion, is that the right way?

    Hi
    Just drag the column to measure label area in pivot table @ columns.
    So the table has to drag and drop to column area on the top so it will get display like
    Sales     SaleToDate
    And the measure label to row side drag and drop it
    sales      saletodate
    values     values
    Regards,
    VG

  • How can you move the objects from one server to another?

    how can you move the objects from one server to another?

    Hi,
    Collecting objects for Transporting
    1. rsa1->transport connection
    2. left panel choose 'object type', middle panel choose 'infocube' and 'select objects'
    3. then choose your infocube and 'transfer'
    4. will go to right panel, choose collection mode 'manual' and grouping only 'necessary objects'
    5. after objects collection finished, create request
    6. If they are $TMP, then change the package.
    7. When you click the Save on the change package, it will prompt for transport. Here you can provide an existing open transport request number, or if you like here itself you can create a new one.
    8. You can check the request in SE09 to confirm.
    Releasing Transport Request  
    Lets say you are transporting from BWD to BWQ
    Step 1: In BWD go to TCode SE10
    Step 2: Find the request and release it (Truck Icon or option can be found by right click on request #)
    Note: First release the child request and then the parent request
    Steps below are to import transport (generally done by basis )
    Step 1: In BWQ go to Tcode STMS
    Step 2: Click on Import queue button
    Step 3: Double Click on the line which says BWQ (or the system into which transport has to be imported)
    Step 4: Click on refresh button
    Step 5: High light the trasnport request and import it (using the truck icon)
    Transport
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/1d733b73a8f706e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/224381ad-0701-0010-dcb5-d74236082bff
    Hope this helps.
    thanks,
    JituK

  • How can I select several emails from 3900 on my 5c and delete the rest easily

         How can I select several emails from 3900 on my 5c and delete the rest easily

    We'll I don't think there's a easy way to delete a lot of emails besides deleting all of them. To delete all of them click on inbox them edit then "mark all" then trash/delete. Other than that you will have to specifically deleted the ones you want to delete.

  • How can I take an item from one image and move it to another image?

    How can I take an item from one image and add it to another image, and rotate it to fit?

    Carefully select the objects of interest in one image and then copy, scale and position them into the other image. Then touch up the composite.
    Have to Love Photoshop for Retouching Images!

  • HT204053 How can I transfer my apps from one account to another

    How can I transfer my apps from one account to another

    Apple will not permit transfer of applications from one account to another. Suppose your mom has presented an iPad to you and before presenting she has downloaded some Apps with her account. If you want to update those Apps, you must know her pass word or send the iPad to her and request her to update and give back. If you feel it is time consuming and difficult, the best way is purchase new iPad and down load  the latest version of App. Whenever you come across you go on purchasing new iPad. This will help you to have latest version of iPad with you.
      Ramanujam, Hyderabad.

  • How can I move purchased apps from one itunes account to another account?

    How can I move purchased apps from one itunes account to another account?

    You can't. The apps must be purchased separately.

  • I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?

    I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?  Any help will be appreciated.  Thank you.

    This should give you some good insight, I'd probably store them on an External HD on the old machine and then just drag and drop to the new machine.
    https://discussions.apple.com/docs/DOC-4141

  • HT4059 How can I move a book from one device to another

    How can I move an iBook from one device to another

    Now when I drag and drop the photo no red # shows up and the photo stays in project 1 and also shows up in project 2 apparently creating a duplicate.
    The projects are the basic containers.  Each image and all its versions are in exactly one project.
    You can use an image in many albums, without duplicating it, also in many products like books, screensaver, slideshows.  But the projects are the basic structure of the library and you cannot have the same image in two different project, without duplicating it by storing the same original image files twice. Use albums to organize your library thematically.
    Sorry, I misread your question.   Dragging an image file between projects should move the image and all its versions to the other project.  Aperture should only duplicate the image, if you hold down the alt/options key while dragging and move the image otherwise.
    Which Aperture version are you using? And which MacOS X version?  Is your profile signature "MacBook Pro with Retina display, Mac OS 9.2.x, Aperture 3.5.1" still valid?
    In Aperture 3.6 on MacOS X 10.10.1 dragging between projects is still working as expected:

  • How can I script moving paths from one file to another?

    Hello. I have 1 image with various color correction layers. The other is the exact same size but only contains paths. How can I script moving paths from one file to another? Thanks, in advance, for any help you can offer. Thanks!

    Thanks! This one actually worked for me. Thanks for your help.
    http://forums.adobe.com/message/3305389#3305389

  • How can I copy cell formatting from one range to another?

    How can I copy cell formatting from one range to another, including text fonts, colours, borders, etc., so that, for example, I can reuse a formatted reconciliation table again in different parts of a sheet?

    Hi George,
    Wayne found the Spinning Beachball of Death, and you will find it too.
    Numbers is not good at handling large datasets. Might I suggest that you group your data into smaller sets (each month, perhaps?) and save each group in a separate Numbers document. Numbers will not link between documents, but you could have a summary Table within each document. Then comes the "clunky" bit of copying all those summary tables into a master document where you do the final processing of the data.
    Regards,
    Ian.

  • How can I pass the photos from one iphone to another?

    how can I pass the photos from one iphone to another?

    Use the Beaming feature. See the info at the ? In iPhoto for iOS.

  • How can I move a photo from one project to another

    How can I move a photo from one project to another without creating a duplicate so I have the same photo in two projects.
    I seems to me in the past when I moved the photo from project 1 to project 2, I would get a number showing the # of photos being moved and you could drag and drop in the 2nd folder and the photos would disappear from project 1 and show up in project 2. is there a setting I am missing.  Now when I drag and drop the photo no red # shows up and the photo stays in project 1 and also shows up in project 2 apparently creating a duplicate.
    Any suggestion?

    Now when I drag and drop the photo no red # shows up and the photo stays in project 1 and also shows up in project 2 apparently creating a duplicate.
    The projects are the basic containers.  Each image and all its versions are in exactly one project.
    You can use an image in many albums, without duplicating it, also in many products like books, screensaver, slideshows.  But the projects are the basic structure of the library and you cannot have the same image in two different project, without duplicating it by storing the same original image files twice. Use albums to organize your library thematically.
    Sorry, I misread your question.   Dragging an image file between projects should move the image and all its versions to the other project.  Aperture should only duplicate the image, if you hold down the alt/options key while dragging and move the image otherwise.
    Which Aperture version are you using? And which MacOS X version?  Is your profile signature "MacBook Pro with Retina display, Mac OS 9.2.x, Aperture 3.5.1" still valid?
    In Aperture 3.6 on MacOS X 10.10.1 dragging between projects is still working as expected:

  • How can I move a clip from one movie to another

    How can I move a clip from one movie to another?

    If it's just a clip, you can simply go to the other project and Add Media/From Files and Folders.
    But if it's a part of your movie -- say a sequence of clips or a clip that's had effects added to it -- you technically can't cut and paste betweeen projects in Premiere Elements. However, some people have been able to do it using the third party program ClipMate, available online.

Maybe you are looking for

  • Unable to change preferences after Security Update 2006-007 10.3.9 ppc

    Problem: System Preferences are locked and cannot be unlocked. And Software Update, and Disk Utility would launch but not work following installation of the S.U. 2006-007 . Solution Steps: 1) Turn off airport card, 2) Connect using ethernet, 3) resta

  • Problem installing Solaris 10 onto CP1500

    I'm trying to install Solaris 10 11/06 onto a CP1500 (UlraSparc-IIi, 440MHZ, 1GB RAM, OpenBoot 3.10.24, using a PS/2 Keyboard). The install CD boots up, but soon after the initial boot (after it displays copyright information but before the installer

  • I keep getting error -1 when I try restoring iPhone.

    I got a alert saying my iPhone 4 couldn't make or recieve calls and I needed to restore it but when I try restoring, I get a unknown error -1. Any explaintion or help resolving this issue is greatly appreciated.

  • 0003 Connection error

    I've read through the forums and found similar issues, but none of the solutions ever seem to work. I'm trying to connect my Sprint Palm Centro using Outlook EAS to our Exchange 2007 system. I have reset and hard reset several times, each time downlo

  • Problema Creative Cloud Desktop Login

    Una volta inserito il mio adobe ID e relativa psw creative cloud va in crash. Qualcuno ha avuto questo problema ed è riuscito a risolverlo?