Remove all lines except 10 random lines

Hello

How to remove all the lines in the JOBS table except 10 lines at random?

Someone asked him before (not here...): http://stackoverflow.com/questions/10820105/t-sql-delete-except-top-1

but I didn't get the answer, and I don't think it will work in PL/SQL.

If the answer to StackOverflow's works in PL/SQL, I will be happy if someone explains me with a better example.

If the answer to StackOverflow does'nt work in PL/SQL, I will be happy if somebody give me an example.

Thank you!

Try this

delete from jobs where rowid not in (select rowid from jobs where rownum <= 10)

Tags: Database

Similar Questions

  • Remove all lines and insert them into Oracle can make performance worse?

    I m working in a project that I need to make a batch update regularly (every 4 months) of excel files. These files have doesn´t excellent key in their ranks.

    The development of a code that deletes all lines and inserts the entire base again is easier than one who checks in all the ranks of its primary key and if necessary update. (sometimes may be a key to 5 columns).

    My question is: if I delete all the rows in the tables of the insert it again, it will cause tablespace fragmentation and in a future loss of performance?

    Is there a way to avoid this?

    Thanks in advance

    Alexander

    This response helped me a lot.

    Thank you all

    Remove all lines and insert them into Oracle can make performance worse? -Stack overflow

  • FTP Dreamweaver CC2015 removes all line breaks in the php files. How can I fix this problem?

    When I upload a php file. The ftp transfer removes all line breaks and creates a continuous line of unique text. I need to download the code with all the line breaks in the original php file correctly.

    I found the problem.

    FTP of Dreamweaver CC 2015 program is not compatible with Yosemite 10.10.5 on all ftp servers.

    The new version of FileZilla (v 3.14.0) is also not consistent.

    Fetch 5.7.5 is fully compatible with Yosemite. With Fetch, I can download the files without any problems successfully.

    In their update, Fetch mentioned that the problem is not with all servers.

    I host on Unix servers with HostGator AMD Opteron processors running on an OS GNU/Linux 64 - bit.

    If you run Yosemite and ftp of Dreamweaver is ruin your line breaks, then use Fetch until Adobe can fix their problem.

  • htmlText remove all line breaks

    In my program, a user can enter any type of text using a RichTextEditor. The entered text has all its illegal xml characters replaced (< with & lt ;) etc.) This string is placed in an xml document. A component is custom, then receives the xml document, converts the html code in its original form and the applicable as the htmlText of a property control of text. This used to work properly. I need string conversions because there are some "metaStrings" which is not replaced according to certain criteria... which is the string {$DATE} would get replaced by the effective date when loading at a later date. As I said, used to work, and I had no problem display of text exactly as the user who created it. Now, for some reason, when I set the htmlText property, all line breaks are removed, of any type. < here > < p > < / p > < /li > < li > for fleas. Remains of formatting, has increased the font size, color, etc., but there is no line breaks.

    I have my chiseled loading code and the following output:

    public static void loadHtmlText(textControl:Text,_textData:XML,_replaceMeta:Boolean_=_false):void
    {
    trace ("loading text html in a text component, loading", textData);
    var html:String = textData.Html.toString ();
    trace ("after parsing a string", html);
    If (replaceMeta)
    {
    trace ('replacing');
    HTML = html.replace(/\{\$DATE\}/,textData.Date);
    Add sequences additional meta here for replacement
    }
    trace ("after the replacement", html);
    textControl.htmlText = html;


    textControl.validateNow (); force a commit
    trace ("value that was set', textControl.htmlText");
    }

    and the following output:

    text html in a text component loading, loading
    < data >
    < html > & lt; TEXTFORMAT LEADING = "2" & gt; & lt; P ALIGN = "LEFT" & gt; & lt; FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = "0" KERNING "0" = & gt; Line 1 & lt; / FONT & gt; & lt; /P & gt; & lt; / TEXTFORMAT & gt; & lt; TEXTFORMAT LEADING = "2" & gt; & lt; P ALIGN = "LEFT" & gt; & lt; FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = "0" KERNING "0" = & gt; Line 2 & lt; / FONT & gt; & lt; /P & gt; & lt; / TEXTFORMAT & gt; & lt; TEXTFORMAT LEADING = "2" & gt; & lt; P ALIGN = "LEFT" & gt; & lt; FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = "0" KERNING "0" = & gt; Line 3 & lt; / FONT & gt; & lt; /P & gt; & lt; / TEXTFORMAT & gt; < / Html >
    NotSet < date > < / Date >
    < / data >

    after parsing a string
    < TEXTFORMAT LEADING '2' = > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 1 < / POLICE > < /P > < / TEXTFORMAT > < TEXTFORMAT LEADING '2' = > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 2 < / FONTS > < /P > < / TEXTFORMAT > < TEXTFORMAT LEADING = "2" > < P ALIGN = "LEFT" > < FONTS FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 3 < / POLICE > < /P > < / TEXTFORMAT >

    After replacing
    < TEXTFORMAT LEADING '2' = > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 1 < / POLICE > < /P > < / TEXTFORMAT > < TEXTFORMAT LEADING '2' = > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 2 < / FONTS > < /P > < / TEXTFORMAT > < TEXTFORMAT LEADING = "2" > < P ALIGN = "LEFT" > < FONTS FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 3 < / POLICE > < /P > < / TEXTFORMAT >
    set < TEXTFORMAT LEADING = "2" > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 1Line, 2Line 3 < / POLICE > < /P > < / TEXTFORMAT >



    Uh, oops, all the strings wordwrapped, makes it impossible to read. There were three blocks < P > < / p > adopted in
    each of them said line 1 line 2 and line 3, respectively, and each of them must be on its own line.

    After forcing the validation of the text control after setting this string, it has that one tag < P > < / p > with all the text inside... 2Line 1Line line 3.


    Any ideas?

    It worked before, I did was move the parameter text in its own function, insead of a function called by the method of my custom component's data provider.

    Thanks for the help.

    Wow, almost three months later, when my work schedule allows me actually to take over this problem, and I have the solution :-). It turns out, I don't know why, or if same Adobe knows about the bug, but if you have fonts using style sheets for all controls on your application, that is, I have a style statement request where I placed the police then redering text html of the text control is bug, usually just remove all line breaks. Why, I have no idea, he is simply. However, the same bug does not occur in the TextArea component. Still, I don't know why, seems silly to me, but as the solution to this problem, simply create a component TextArea, backgroundAlpha styles set to 0, its borderStyle to 'none', set the editable to false and boom, you have a component of scrolling text, which doesn't render the text html incorrectly.

  • Removes all characters except numbers

    Hi all

    I want to reformat to following phone numbers. As you can see it in what follows, I want to delete all characters except numbers and it does not start wirh 0 0 at the beginning of the f-number. And the length is 11. What do you recommend?

    (543) 456-35-50 = > 05434563550

    (555) 555-55-55 = > 05555555555

    (210) 111-11 / 11 = > 02101111111

    Thank you

    Hello

    3018678 wrote:

    Hi all

    I want to reformat to following phone numbers. As you can see it in what follows, I want to delete all characters except numbers and it does not start wirh 0 0 at the beginning of the f-number. And the length is 11. What do you recommend?

    (543) 456-35-50-online 05434563550

    (555) 555-55-55-online 05555555555

    111-11 / 11 (210)-online 02101111111

    Thank you

    To remove all characters except the 10 digits, you can use REGEXP_REPLACE

    REGEXP_REPLACE (str, '\D')

    To put a "0" at the beginning of the string (if it isn't already begin with a '0'), you can use REGEXP_REPLACE even once:

    REGEXP_REPLACE (REGEXP_REPLACE (str, '\D')

    , '^([^0])'

    , "0\1".

    )

    I don't think that there is a way to do both things wih a single integrated function call.

    There is a requirement on the length being 11?  What happens if that comes into conflict with one of the other requirements?  For example, if the string is already long of 11 characters, but does not begin with a '0', do you want to add a "0", which makes 12 characters?  What happens if the length, after removing the numbers no, is very small, say 1?  (You can use LPAD adds however many ' 0 s you need.)  If the length (after removing the numbers) is 12 or more?  What happens if the string does not contain any what numbers at all?

    If these things are questions, then post CREATE TABLE and INSERT statements for some examples of data, accurate results, you want that data, and explanations.

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

  • [basiljs] remove all pages except one

    In a script, I create pages, export to PDF, remove pages and then create a new etc.

    Right now I use this:

    [code]

    for (var j = b.pageCount (); j > 1; j-) {}

    b.removePage (j);

    }

    [/ code]

    But it's really slow. I think that indesign made many calculation after deleting a page (deadline: link textfields) so it would be more efficient to remove all pages at once.

    Now my question is how do?

    I tested and if I delete about 5500 empty pages with the script it takes about 8 minutes.

    If I select all in indesign, and then delete it takes about 10 seconds.

    Another way to speed up a litle is to erase all the content. It will take a long time but probably a bit faster.

    Thing is that I have

    b.Clear (b.doc ());

    but this removes the master page as well and I need to keep the master page.

    In short, how to remove all pages (except one since indesign needs a single page) at the same time?

    Hello

    I will remove a lot of pages in indesign with

    • Use documentPreferences.pagesPerDocument (faster)
    • use while loop or for
    • Close doc without saving changes, and then open again. (in some cases)

    Here's the test code, run with old Macbook Air + CS5 + OSX10.7

    var pp = function (args) {
      $.writeln(args);
    }
    
    var remove_all_pages_use_pref = function (doc) {
      pp("start deleting (use preferences)");
      $.hiresTimer;
      doc.documentPreferences.pagesPerDocument = 1;
      pp("end deleting");
      pp($.hiresTimer);
    }
    
    var remove_all_pages_use_loop = function (doc) {
      var i = doc.pages.length;
      pp("start deleting (while --)");
      $.hiresTimer;
    
      while (i--) {
        if (i==1) {break;}
        doc.pages[i].remove();
      }
      pp("end deleting");
      pp($.hiresTimer);
    }
    
    function main() {
      var doc = app.documents.add();
      $.hiresTimer;
      doc.documentPreferences.pagesPerDocument = 5500;
      pp('# create 5500 pages');
      pp($.hiresTimer);
      var indd = new File("~/Desktop/5500.indd");
      doc.save(indd);
    
      pp("------------");
      remove_all_pages_use_pref(doc);
      doc.close(SaveOptions.NO);
    
      pp("------------");
      pp("# try another way");
      var doc2 = app.open(indd);
      remove_all_pages_use_loop(doc2);
      doc2.close(SaveOptions.NO);
    }
    main();
    

    result

    # create 5500 pages
    30395026
    ------------
    start deleting (use preferences)
    end deleting
    28215999
    ------------
    # try another way
    start deleting (while --)
    end deleting
    268641063
    

    Thank you

    mg

  • Remove all line breaks

    Hello

    When you paste Acrobat PDF files into InDesign, I often have a ton of extra newlines, I don't want to. Someone at - it a script to remove all the jumps of line in a block of text?

    Why you want to script?

    Just go find grep select request: multiple return unique back, and then click all change.

    Please make sure that you have selected the Option to search: story if you want to change the selected block of text.

    Shonky

  • userChrome.CSS - remove all toolbars except front/rear, refresh and home

    I need to configure firefox in almost-kiosk mode. I want to disable all toolbars except for the "back" button, next button, refresh and home buttons.

    I did find something that allows you to hide the bookmarks toolbar. And if I keep at the entrance of #urlbar, front and rear buttons appear, but do not work (they're grayed out)?

    That's what I have so far:

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
    #searchbar {
    	display: none;
    }
    #main-menubar  {
    	display: none;
    }
    #urlbar  {
      display: none;
    }

    You can hide the Bookmarks Toolbar window and customize with these identifiers:

    #PersonalToolbar { display:none!important; }
    #CustomizeToolbarWindow { display:none!important; }
    

    ID #personal - brand - pages is for the bookmarks toolbar item that can be placed on a toolbar through the window customize.

    Try to drag the URL bar and search and other items that you hide in the toolbar palette.

    It seems in the history of the button B/F run after a reboot.

    It is usually best to use the DOM Inspector to get the ID or class of items of toolbar names.

  • Remove all lines but more recent of each

    Hello

    I have a table with about 3.6 million lines and came up with an idea of how to improve the speed of a query. Basically, my idea was to create a query that took (finally to enter into a historic table) all records associated with a particular area, except for the 2 last because they are the only ones used. For example:


    SPORT |    DRIVE |    DATE
    ========================
    RONALDO FOOTBALL 8 JULY 09
    RONALDO FOOTBALL 11 JUNE 09
    RONALDO FOOTBALL 22 MARCH 09
    FEDOR MMA 10-SEP-09
    FEDOR MMA AUGUST 15 09
    FEDOR MMA 11 AUGUST 09

    The idea is that the last recordings of ronaldo & fedor would be removed somehow... All the things I've tried so far have been a disaster =)
    Thanks for any help.

    Mike

    The first step would be to create a select that adds a new column to your table that contains some sort of grade.
    Something like this:

    select sport,
        player,
        date,
        dense_rank () over (partition by sport, player order by date desc) rank,
        row_number() over (partition by sport, player order by date desc) nr
    from yourbigtable
    

    Rest can be support on this. The difference between the two columns is that grade will give the same number for identical dates, while row_number() will give a new number for each line by group.

  • Button to remove all empty lines

    I am trying to create an interactive form that has a button that adds lines for the user to enter questions and another to add follow-ups to the authorities. There are 3 different sets of these. However, we do not want to add a button to remove all lines, in order to allow the accidental deletion of data already entered.  I would like to create a button that deletes all empty lines, including all subforms.  Either that, or to save the document, would be deleted all empty lines - depending on what would be easier. Help, please!  It seems that this will be a complicated task and I'm not well versed in LiveCycle to figure this on my own.

    Thank you!

    In the object > range of liaison. I've included a screenshot on the forum.

    Niall

  • Is DataBlDel() the best way to remove channel lines?

    Hello

    I try to delete specific lines in a block of channels and find that DataBlDel() is extremely slow. Of course, my channels is fairly long (~ 36e6 lines), but I find that it takes hours to remove a handful of lines. Is there a better way to do it?

    The code I use is listed here:

    Option Explicit

    I have Sun

    I have = 1

    <=>

    < 0="">
    Call DataBlDel("[]/Time",i,1)
    Call DataBlDel ("[]" / Time Delta ", i, 1")
    Call DataBlDel ("[] / Force load Pin (PST_002_FCE)", i, 1 ")
    On the other
    i = i + 1
    End If

    Wend

    Everything is very appreciated, advice

    PorridgeMan.

    Hi PorridgeMan,

    This task can be done loads faster.  First, the DataBlDel() command is working on multiple channels and multiple lines at once, so you call it many more times to you.  If the time of<0 rows="" are="" contiguous,="" the="" ideal="" approach="" would="" be="" to="" use="" the="" find()="" function="" to="" get="" the="" first="" row="" where="" time="">= 0 and use exactly a call DataBlDel() to remove all lines not valid 3 channels.  If the time<0 rows="" are="" not="" contiguous,="" then="" i'd="" recommend="" using="" the="" calculator="" approach,="" like="">

    L1 = NOC ("specifying")
    L2 = ONC ("/ time Delta")
    L3 = ONC ("/ Force charge Pin (PST_002_FCE)" ")
    IF L1 0 > AND L2 > 0 AND L3 > 0 tHEN
    Call FormulaCalc ("Ch (L3): = Ch (L3) + NoValue * (Ch (L1)")<>
    Call FormulaCalc ("Ch (L2): = Ch (L2) + NoValue * (Ch (L1)")<>
    Call FormulaCalc ("Ch (L1): = Ch (L1) + NoValue * (Ch (L1)")<>
    Call ChnNoVHandle (L1, L2 & "," & L3, "Delete", "XY", 1, 0)
    END IF

    Brad Turpin

    Tiara Product Support Engineer
    National Instruments

  • Remove the line from the Excel report when generating reports

    Hi all

    I try to delete whole lines of the report excel during the generation of the report in excel, but I'm not able to do this. Here I am attaching an excel template, in that I want to delete line no 3 to 5 How can I do this. I'm using LabVIEW 8.6 Report Generation Toolkit for Microsoft Office 1.1.3

    Thanks and greetings...

    If there is no function to generate report for simple operations like this, then use the palette of VBA macros to run this code snippet:

    'remove all lines between two rows inclusive '.
    Void DeleteRows (intTopRow As String, intLastRow As Integer)
    Range (cells (intTopRow, 1), (intLastRow, 1)). EntireRow.Delete xlShiftUp
    End Sub

    Import Excel module allows to load the .bas file then run Excel Macro with parameters 3 and 5.  Check your security settings if you get an error in the macro.

  • MERGE statement - delete all lines?

    Hi all

    I am using Oracle 11 g and in my application, I need to update several existing records in a table in the Production environment. For this, I wrote a SQL logic using the "MERGE INTO" statement.

    Here's the SQL logic that I used.

    merge into the tar of the target

    a_l'_aide_de)

    Select

    EC.prim_id,

    CSM.Cptr,

    CSM.prm,

    CSM.scnd,

    CSM. PTXT,

    CSM.entn,

    CSM. ENPR,

    CSM.sevr

    t2 t1 ec cat inner join

    on ec.x = cat.y

    inner join s t3

    on ec.p = q.a.

    inner join t3 b

    on ec.m = b.n

    inner join t4 csm

    on)

    (lower (replace (cat.xn, b.sname |))) ((('-', ")) = lower (csm.xn))

    and (below (replace (s.yn, b.sname |))) ((('-', ")) = lower (csm.yn))

    and (lower (b.rn) = lower (csm.rn))

    )

    where ec.cptr is null

    and ec.prm is null

    and ec.scnd is null

    and ec.ptxt is null

    and ec.stxt is null

    and ec.entn is null

    and ec.enpr is null

    and ec.sevr is null

    ) CBC

    on)

    SRC.prim_id = tar.prim_id

    )

    When matched then update

    Set tar.cptr = src.cptr,

    tar.PRM = src.prm,

    tar.scnd = src.scnd,

    tar. PTXT = src.plcy_txt,

    tar. MID = "offline."

    tar.entn = src.entn,

    tar. ENPR = src.enpr,

    tar.sevr = src.sevr

    I doubt here, that is, if the condition WE in education MERGE gets failed then is it insert/delete all records in/to from the target table. But I think that it won't happen because I'm not specify the statement as 'WHEN DO NOT MATCHED THEN' right? Or default oracle will insert/remove all lines if the condition does not. ???

    Your help is very appreciated.

    Thanks in advance

    If your question is addressed, then close this thread.

  • Remove the line breaks in the HTML Source Code

    Is it possible to remove all line breaks in the code source HTML generated by Dreamweaver? After using the Dreamweaver design view window, I want to assure you that all the source code of the html page I created is going on a single line. Is there a simple way to remove all line breaks, or tell Dreamweaver to create the HTML code on a line?

    Ki Song says:
    > Is it possible to remove any line break in the HTML source code
    > generated by Dreamweaver? After the use of the design view window in
    > Dreamweaver, I want to assure you that all the source code for the
    > goes from html page I created on a single line. Is there an easy way
    > to remove all breaks online or tell Dreamweaver to create the HTML code
    > code on a line?

    http://www.TJKDesign.com/articles/whitespace.asp

    HTH,
    --
    Thierry
    Articles and tutorials: http://www.TJKDesign.com/go/?0
    Perfect FAQ page: http://www.TJKDesign.com/go/?9
    Templates CSS - P: http://www.TJKDesign.com/go/?1
    CSS tabs menu: http://www.TJKDesign.com/go/?3

  • I still have not found "help" to tell me how to remove all the lines and columns beyond those needed for my spreadsheet.

    I used several worksheets.  More allows me to specify the rows/columns and then delete them.  This is to remove all the lines/columns beyond those set up and formatted for my spreadsheet.   I tried many ways to remove all additional lines/columns, but without success.  I even took the time to scroll down/on to highlight all the unnecessary lines and columns, but they do not remove it.
    Any suggestions?  I used spreadsheets most allow me to specify the number of rows/columns for my worksheet

    You can ask your question in the office | Excel Forum because it is not really a problem of Windows XP performance and maintenance.

    Office | Excel

    http://answers.Microsoft.com/en-us/Office/Forum/Excel

    Also, providing specific information may help to get a faster response or better, such as the version of Office or Excel? version of Windows XP? Home, Pro, 32-bit or 64-bit.

    I hope this helps.

Maybe you are looking for

  • How did the majority of my messages have prefix * SPAM * even if I have them in my address book?

    Most of my emails have started to come through with * SPAM * before the subject line. Where is this from-Thunderbird? It's more boring! It makes no difference if the sender is in my address book, or if I leave hidden content. And even if I'm on the s

  • HP 4500 scanner is currently in use

    I have a series of e-all-in-one HP Envy 4500 and when I scan I revcieve the message error "scanner is currently in use.  Wait until your previous task is completed, and then try to scan the image. "However, I don't have another scan or printing in us

  • Why not a contact on my iPhone displayed in iCloud?

    I have the iPhone 5. A single contact, among hundreds, on my iPhone refuse to appear on the iCloud. All other contacts are very good. What would cause this a touch of get not synchronized to iCloud. I am access iCloud through Safari on the Net. In se

  • Re: Need of Satellite L500-13W - installing Windows XP - details

    I have a laptop Toshiba L500 13W originally shipped with windows Vista.I have already installed Windows 7 ultimate 32 bit, but I don't like Vista or 7, becausa of this new interface of the taskbar.So I thought to install windows xp on it. Toshiba off

  • Not all of the memory installed in Equium A60 appears

    I'm unraveling an A60, A60-156 532 P4 / XP HE/256 MB / 40 GB/15TFT/DVD SuperMultiPSA67E - 00400C 85 The problem is that Windows XP and BIOS do not show that there is the 256 MB of RAM installed.BIOS shows: 196608KBWindows shows: 192 MB I just updated