How to do group by with the rowid

CREATE OR REPLACE PROCEDURE DELETE_RECS
AS
BEGIN
DELETE FROM x
WHERE x_date < SYSDATE - 30
AND ROWID NOT IN (SELECT rid
FROM (SELECT ROWID AS rid
FROM x
ORDER BY x_date DESC)
WHERE ROWNUM <= 10);
END;
have to delete the values in the following scnerious. like
group by. e.g
e.g in a table there are group of values say
444 - having 20 rows
555 - having 15 rows
666 - having 17 rows.
should get the result as
444-10 rows with recent dates
555-10 rows with recent dates
666 - 10 rows with recent dates
but the above query deletes only on date. need help to do group by in the inner query
group by x.columnname1,x.columnname2 in the above query

DELETE FROM x
WHERE ROWID IN (SELECT ROWID
                   FROM (SELECT ROWID,
                                row_number() over(PARTITION BY columnname1,columnname2 ORDER BY x_date DESC) rn
                           FROM x)
                  WHERE rn > 10);

Similar Messages

  • How to run group solve with the batch manager

    I'd like to know if it is possible (and how) to run group solve defined in OFA with the batch manager.
    Thank you
    Luigi Polverini
    Synesis s.r.l.

    OFA uses its Task Processor rather than Batch Manager to run tasks in batch. Group solves can be scheduled this way by submitting the group solve task to the TP, and then rescheduling it in the Task Queue window.
    null

  • HT1695 How to connect my iPhone with the printers at school? Many thanks

    How to connect my iPhone with the printers at school? Many thanks

    They must be Airprint capable printers... if they are not, then there is no supported way of connecting to them.
    Airprint 101

  • HT201269 I had an old PowerMac and now i have the MacBook Pro.  I am not use to the new iTunes.  I use to be able to drag music that I had added onto my computer from a CD to my iPhone or iTouch.  How do I do that with the new iTunes?

    I have CDs that I want to import onto my new MacBook Pro to my iPhone.  I am not use to the new iTunes with the Mountain Lion software.  I had an old PowerMac that had the Leopard software and I was able to drag those songs to my iPhone.  I can't find that option.  When I find the song I want to add to my iPhone, I tried dragging it to the top when it shows that my iPhone is connected with iTunes.  Or how do i do this with the Cloud?  I am new to that as well.  Seems like it just held my purchased songs from iTunes.

    iCloud only has content purchased (or free) from iTunes. Ripped music or music from other sources is only on your computer. As the iPhone can only sync with one computer at a time you should copy the iTunes folder from the old computer to the new one. It's in the Music folder on the old one, just copy the entire folder to the Music on the new computer. When you first sync your iPhone content will be replaced by the content of the new computer.
    You can optionally enable iTunes Match. This searches the non-iTunes content in iTunes or on your iPhone and finds the original digital version on the Internet if it exists. This then becomes your backup. If you have music that it cannot find it will upload it to your cloud storage, but you may have to pay for the storage if it is over 5 GB total (along with your backup). iTunes content and Match content are not included in the 5 GB free limit.
    Usually to fix mail issues just delete the account, reset (reboot) the phone by holding HOME and SLEEP until an Apple logo appears, and adding the email account(s) back.

  • I updated my ipod and it deleted my entire library how do I restore it with the backup I have saved?

    I updated my ipod and it deleted my entire library.  How do I restore it with the backup I have so all songs will be available in the cloud; which I paid extra Money to increase memory for?

    The backup that iTunes makes does not include apps, music, synced videos and photos. Se:
    iTunes: About iOS backups
    You will have to sync the items back form yur computer/iTunes library to the iPod via iTunes. If they are not on the computer you can redownloa d some iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • In Pages 09 we can do Mail Merge and Import Styles from a document. Can someone please explain how we can do this with the new version of Pages 5.1. Even Apple solutions are only valid for Pages Version 09. What a DOWN GRADE!

    In Pages 09 we can do Mail Merge and Import Styles from a document. Can someone please explain how we can do this with the new version of Pages 5.1. Even Apple solutions are only valid for Pages Version 09. What a DOWN GRADE! Thank god Pages 09 is still there.

    …and the other 98 missing features.
    Just use Pages '09, which should be in your Applications/iWork folder.
    Rate/review Pages 5 in the App Store.
    Peter

  • In iPhoto, how can I export images with the metadata - including the title and caption information - intact as part of the image?

    In iPhoto, how can I export images with the metadata — including the title and caption information — intact as part of the image?

    Check those boxes in the export dialogue - Exporting From iPhoto
    LN

  • How to open a file with the extension x3f (sigma)

    how to open a file with the extension x3f (sigma)?

    RAW data from the following Sigma cameras is currently supported:
    DP1
    DP1s
    DP2
    SD9
    SD10
    SD14
    If your camera is among these, then simply import the photo as usual. https://helpx.adobe.com/lightroom/help/importing-photos-lightroom-basic-workflow.html

  • How to transfer own -done with the iPad- movies from iPad to PC ?

    How to transfer own -done with the iPad- movies from iPad to PC ?
    The fotos are possible to transfer, but not the movies

    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support

  • How do i mail merge with the new Pages and Numbers?

    How do I mail merge with the new Pages and Numbers?
    On Pages 09 I have a document that draws variable data from a spreadsheet created in Numbers.
    With the new Pages and Numbers program update, my links are lost and I am unable to see how to correct this.

    Thanks Peter,
    very disappointing.
    My Pages 09 keeps opening in the new one.
    I dont think they want me to be a loyal customer anymore.
    They changed Final Cut Pro, so now I use Premier Pro
    Aperture 3 has been left behind so now I moved to Lightroom 4.
    And now Pages 5 does not have a vital component, so back to Word.
    Sad day
    Thanks again

  • How do I copy captions with the photos into a photobook?

    How can I copy captions with the photos into a photobook.  The photos are in Adobe Elements 6.

    Good day!
    The photos are in Adobe Elements 6.
    Then you really should not be posting in the Photoshop for Beginners Forum, I guess, but in the Forum dedicated to that piece of software.
    http://forums.adobe.com/community/photoshop_elements
    Regards,
    Pfaffenbichler

  • Can someone tell me how to create accounting entries with the account status as error

    Hi,
    Can someone tell me how to create accounting entries with the
    account status as error?
    Thanks!!
    Danny

    It's call fixed/static background, and it is NOT directly support by iweb, you will need post processing either in html or javascript.
    Varkgirl (you need to search the previous forum) and I did it since iweb1:
    try Safari, and scroll: http://www.geocities.com/[email protected]/Links.html
    invisible link? roddy, fishing for info again?

  • How to change a connection with the database in Runtime?

    How to change a connection with the database in Runtime?
    My connection was made using ADF Business component (ApplicationModule).
    ADF Swing.
    JDeveloper Studio 11.1.1.4.0.

    When deploying ADF applications with database connection, you should be using JDBC data sources configured in the weblogic server.
    You could change the JDBC data sources to a different DB instance or location - by changing the JDBC data source and restarting the weblogic server.
    For more details, check
    http://techiecook.wordpress.com/2010/12/02/oracle-weblogic-adf-datasources/
    Thanks,
    Navaneeth

  • How to use TYPE addition with the OPEN DATASET ?

    Hi,
    How to use TYPE addition with the OPEN DATASET and what is the use ?
    For Example:
    OPEN DATASET 'test.dat'
      TYPE 'lrecl=80, blksize=8000, recfm=FB'
      FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Also, if I wish to do the same for a .CSV file how can we do it.
    Thanks,
    -Sid

    Hi,
    OPEN DATASET 'test.dat'
      TYPE 'lrecl=80, blksize=8000, recfm=FB'
      FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
    For more information press F1 on OPEN DATASET.
    Thanks

  • How to use glob search with the wildcard in command find?

    How to use glob search with the wildcard in command find?
    I want to find any file its names begin with "readme" string using command find. Why the following command cannot work?
    $find /usr/share/doc -name readme*
    However, the following commands can work?
    $find /usr/share/doc -name readme\* or
    $find /usr/share/doc -name readme'*'
    I want to know: After using the “\” or ' ', why the wildcard do not become a character "*"?(still a metacharacter).
    Another question:
    I want to find any file its names begin with "readme*" string using the command find.What command should I use?

    I want to know: After using the “\” or ' ', why the
    wildcard do not become a character "*"?(still a
    metacharacter). The backslash is known as an escape character. It means 'use the character value of the next character, not the special meaning' It is used in a lot of places such as command line, global regular expression patterns, and editors such as vi.
    In a typical shell, the splat (*) expands to all file names before passing the file names to the current command. So a \* sequence tells the shell to pass a *, not a list of file names, to the command.
    Demo - OpenSuSE Linux 10.3
    - I have a bunch of files. Let's list those that end in grid. Create one called *grid, and list again
    pops@fuzzyVM:~/pops> ls 
    a  b  c  startgrid  stopgrid
    pops@fuzzyVM:~> ls *grid
    startgrid  stopgrid
    pops@fuzzyVM:~> ls \*grid
    ls: cannot access *grid: No such file or directory
    pops@fuzzyVM:~> touch '*grid'
    pops@fuzzyVM:~/pops> ls
    a  b  c  *grid  startgrid  stopgrid
    pops@fuzzyVM:~/pops> ls *grid
    *grid  startgrid  stopgrid
    pops@fuzzyVM:~/pops> ls \*grid
    *grid
    pops@fuzzyVM:~/pops>In the above, how would I remove the file *grid, and only that file?
    Another question:
    I want to find any file its names begin with
    "readme*" string using the command find.What command
    should I use?What were the results of the two versions you tried? And why?

Maybe you are looking for

  • Mdworker -fan related problem

    Since yesterday evening i'm experiencing some problem. I've noticed it's related to mdworker running in the background constantly when i'm downloading (using torrent client transmission). Whenever i'm downloading multiple files, going up to 100 kb/s

  • How to make link open in new TAB and not new window

    Mac users can do the following... http://www.switchingtomac.com/tutorials/how-to-force-safari-4-to-open-links-in-a -new-tab-instead-of-a-new-window/ how can this be done for WIndows users? Using Safari 4.0

  • Android: Publish/Testing my app on an Android Device

    Hello, i got this problem with publishing/testing my app... I created an app with adobe flash cs6. While i tried to test it on a Galaxy GT-S5570, while publishing i got an error wich says that "Device Error: please check if there is enough space on t

  • Reconfigure existing OIM on fresh weblogic Installation

    Hi, My OIM 9.1.0.1 is configured on WebLogic 10.3 but I am not able to start the weblogic server. It hangs after showing the STARTING Message; not getting error message also. So, is there any way in which I can reconfigure the existing OIM on fresh W

  • Help on stuttering video after FMS call Stream.get('liveBroadcastStream').play('liveFeedFromFMLE', -1, -1, true)

    Hi, We recently encountered a very strange issue that we urgently need help: With FMS 3.5, we created a new live application according to relevant documentations. Within this application (main.asc), on periodically basis (e.g. 45 seconds), we use Str