Do I have any function/way to divide the rows into un-equal size buckets?

Just like the function NTILE divides the rows into almost equal size buckets, do we have any way to divide the rows into un-equal (randomly decide) buckets so that eg. I can get 4 rows in bucket_1, 38 rows in bucket_2, 17 in bucket_3, ..... Only things is that each bucket should have rows from 1 to 50. (fixed limit).

with source_table as (select object_type, object_name from all_objects where rownum <= 100),
     t            as (select rownum as rn, s.* from source_table s),
     cnt          as (select count(*) cnt from t),
     bucket       as
     ( select bucket_id, bucket_width,
           sum(bucket_width) over (order by bucket_id) - bucket_width + 1 as rn_start
         from
         ( select level as bucket_id, ceil(dbms_random.value(0, 50)) as bucket_width
             from cnt
             connect by level <= cnt
select bucket_id, object_type, object_name from t, bucket
  where rn between rn_start and rn_start + bucket_width - 1
  order by bucket_id
;

Similar Messages

  • How do I shrink a MS doc to a smaller page size, not just divide the document into a smaller size?

    I am trying to shrink a microsoft word document from a standard page to a smaller, possibly half page, to create a printable reference booklet I plan on laminating but when I try to change the page to a different size, it doesn't shrink the document to that size, it just breaks that page into a bunch of smaller pages, breaking up whatever chart or words were on the page. Any insight?
    Ex. I have a chart that looks like this on a standard letter size MS word doc page layout.
    Header 1
    Header 2
    Header 3
    Header 4
    I want to change this so that is it on a landscape "half letter" MS word doc page size, shrinking the chart, and keeping it in tact.
    When I change the page layout size, or try to copy paste to the above mentioned half letter doc size, the chart breaks up into multiple pieces, creating 3 or 4 "half letter" sizes, with only part of the chart on each.
    Help MUCH appreciated!

    You'll need to create a custom page size under "Page setup..." in Word. Word really isn't the best application for what you're trying to do, but a custom page size with custom margins should work.
    EDIT: Oh, and you'll need to change the sizes on your table, obviously.
    Clinton
    Message was edited by: clintonfrombirmingham

  • Western Digital My Book World EditionI have bought a WD My Book World Edition to use for back-up of my iMac, but when I try and log onto the drive with Apple time Machine (back-up software) or connect in any other way i get the message 'There was a proble

    I have bought a WD My Book World Edition to use for back-up of my iMac, but when I try and log onto the drive with Apple time Machine (back-up software) or connect in any other way I get the message 'There was a problem connecting to the server "MybookWorld.local" The version of the server you are trying to connect to is not supported. Please contact your system administrator to resolve the problem'
    It is a brand new iMac and running Lion OSX
    Any ideas on how to solve would be gratefully received?

    Followed the directions on this page and it worked!
    http://forums.macrumors.com/showthread.php?t=1102423
    Part One - Turn on SSH (in the admin panel)
    [1] Go to to http://mybookworld.local
    [2] login: username will be admin, password will be whatever you have setup. If you can't remember it should be in your Mac OS X keychain (Utilities > Keychain Access, search for "mybookworld"). If you have not changed if from the default the password will be admin as well.
    [3] Switch to advanced mode.
    [4] From the System tab, pick Advanced.
    [5] Enable SSH Access, and click submit.
    [6] Click on the network tab and then the LAN button
    [7] Make a note of the IP address
    Small, maybe obvious, but nevertheless important point: For the install to work, your NAS needs to be connected to a router with internet access.
    Part Two - Install netatalk2.2
    [8] Open Terminal.app (Utilities > Terminal)
    [9] Enter the following command (substitute in 127.0.0.1 for the actual IP address you noted down in step 7), then hit return:
    Code: 
    ssh [email protected]
    [10] When prompted, enter the ssh password (will be welc0me).
    [11] You are now going to download the installer. Enter the following command, then hit return:
    Code: 
    wget http://mybookworld.wikidot.com/local--files/netatalk2-2-on-whitelight/install_netatalk.sh -O install_netatalk.sh
    [12] Once completed, you will need to run the installer. Type:
    Code: 
    sh install_netatalk.sh
    [13] You will be asked a number of question during install, answer yes to all. When asked about the "DHX2 login process", I opted to install the modified version, so I can confirm it works.
    [14] Once the box has restarted, you should be able to connect to your afp shares and continue to use Time Machine.

  • Is there any other way to play the shuffle in a car if it doesn't have an aux facility??

    Is there any other way to play the shuffle in a car if it doesn't have an aux facility???  Or I wondered if you could play it through a smart tv...or do you need an apple tv box???

    Is there any other way to play the shuffle in a car if it doesn't have an aux facility???
    There is not.
    Or I wondered if you could play it through a smart tv...or do you need an apple tv box???
    Not with the Apple TV, but if the Smart TV has an AUX port, you can connect it that way.
    B-rock

  • By mistake i ereased my mackbook pro's disk. and when is restared it recovery page opened. and i did not purchase the osx mountain lion. do i have any other way to recory it without purchasing the copy of osx. can i do it using a usb having image file of

    by mistake i ereased my mackbook pro's disk. and when is restared it recovery page opened. and i did not purchase the osx mountain lion. do i have any other way to recory it without purchasing the copy of osx. ?can i do it using a usb having image file of mountain lion?

    Did you buy your machine second-hand? That's really the only way you would have to purchase OS X 10.8.x from the App Store... but, yes, if you have a USB thumb drive with a bootable installer (such as made with Lion DiskMaker) you can boot from that and reinstall OS X.
    Clinton

  • I lost my iphone 5 and i don't have i tunes.can i use my phone number or any other way to get the serial number?

    i lost my iphone 5 and i don't have i tunes.can i use my phone number or any other way to get the serial number?

    No.
    Serial number is available If you have:
    1. The iPhone box when you bought it, if you still have it.
    2. The receipt, where you bought the iPhone
    3. Computer iTunes, if you have synced or backuped the iPhone.
    4. https://supportprofile.apple.com if you have iPhone registered

  • Optus have unlocked their end but have a complicated way to unlock the phone. I can not follow , any help?

    Optus have unlocked their end but have advised acomplicated way to unlock the phone which I can not follow.Would appreciate any help

        Hello RTM58,
    I'm sorry you haven't heard back about your ticket. The representative that opened the ticket is notified when it is completed, but we can check the status for you now. Please feel free to send me a direct message after you accept my follow request and send me a request. You can also dial 800-922-0204 and review the ticket with a technician.
    AndreaS_VZW
    Follow us on Twitter @VZWSupport

  • My Email does not have any functions on the bottom bar?

    My Email does not have any functions on the bottom bar?
    I open an email and there no functions to delete forward or reply with.  Anyone have an idea?

    Hi
    Just to clarify what your saying under menu > settings > Connectivity the only option you can see is Bluetooth? There are no other options to select?
    Because under the connectivity menu you should be able to Network, WiFi, Bluetooth, USB, Settings, Connection manager, Mobile data tracker, Data Transfer, Video sharing, Admin settings and play via radio.
    All the options should be visible on the connectivity menu on a N8 with Nokia Belle installed.
    If you find this post helpful, a click upon the white star at bottom would always be appreciated.
    If it also solves your problem, clicking ACCEPT AS SOLUTION below it will benefit other users!

  • Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either.

    Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either. Anyone have a solution?

    Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either. Anyone have a solution?

  • Is there any other way to  limit the data a user can see

    We are using Discoverer 10.2.xxx
    We are running it against an Oracle applications database but we do not have Discoverer integrated with the apps. I have created database users for discoverer and granted access to the data at the db level.
    We have about 40 salesreps and we only want each rep to see their own data. We have a high turn over with the reps
    For now, I have created the row level security in that folder in my eul. If the username = XXXX then Salesrep = XXXXX
    OR
    If username = YYYY then DSM = YYYY
    etc.. This goes on for about 40 users We have 3 levels of "users" - Salesrep, DSM or RSM (District or Region sales manager)
    These users are setup in my apps and I can write a database procedure to select their salesrep name based on their username.
    Is there any other way to limit the data that the salesreps can see ?
    Possibly with a stored procedure some way?
    Thanks
    Angie

    At a previous client's, I had created a system not too unlike what you're describing.
    Basically, I created an Oracle table that stored information concerning the salesperson as in Oracle Apps the data was not reliable for what they were doing (ie: with adding Apps modules, sometimes salesperson data was there, but with say, CRM, it was in another place, etc.).
    So, since this table was going to be used for driving everything about a salesperson (commissions, who they report to, when they started, territory, when / if they moved territories and/or manager, etc, etc.) I put lots of good stuff in it that would make life easier for them.
    The end user in charge of all this had was given a Form to add, edit, delete all this good stuff and they were happy.
    When it came time for security, it worked like a charm in that I used the concept of the BIS views where a user has an apps id associated to them and all data was filtered by that id. All I really had to do was to create this view that simply filtered data to that user's id. Then whenever I had a Discoverer report for salespeople, managers, etc. I just made sure the folder used had a join to this filtering view and I chose an item from the filtering view and all worked fine. All Discoverer reports only returned row level information for the salesperson who ran it.
    Likewise, the same Oracle table was queried by another security view that only brought back the same IDs for the salespeople associated to each manager. When this simple view was joined to any sales Discoverer folder (and used in Disco), it limited all data to the salespeople the manager was responsible for.
    Obviously this is just an overview and would take pages to explain, but essentially, if you can associate some kind of unique ID to each salesperson (I used the one returned in BIS views when someone logs into Apps, but you could just assign a different in your case), then you can create a view that filters to that id. Then when that view is brought into the EUL and joined to any other folder in the sales area (and you choose a column from the security view), you'll have what you're referring to - row level security for all salespeople and managers.
    When it works - it sure does look impressive.
    Russ

  • Is there any function module to get the variables used in a query?

    Hi experts
    Please, do you know if is there any function module to get the variables used in a query?
    Thanks and regards
    Luis

    Hi Srini
    Yes, I have checked the tables but I need a function module
    Thanks anyway!
    Luis

  • Adobe's website broken - Any other ways to get the serial number?

    Hello.
    I bought the student's version of Adobe's Creative Suit.
    Now I need to get the serial number from a link which doesn't exist. It says that it is broken.
    Is there any other Way to get the Serial Number because without it I can not activate the product.
    Can somebody help me please?
    Greetings.

    Hi Dendylein2,
    One  tip to get you up and running quickly: You can use Creative Suite before getting your serial number, by selecting the installation option that allows you to install the product as a trial. You can then use the serial number to convert it to the non-trial version later.
    Did you purchase your Creative Suite in North America or elsewhere (the  correct solution can vary, depending on where you purchased the Creative Suite from).
    If you purchased in North America, have a look at the options in the table and choose the link that matches your situation:
    I have a Student and Teacher edition product
    If you purchased outside of North America, and from a reseller, the website is down and I apologize for that. This is known and Adobe is working on a fix.
    Thank you for posting.

  • Any other way to display the images in jsp

    Dear All,
    I had a program in get the image in database and display the image in jsp file.
    Generally we are using
    setContenttype(image) and write the binary values in jsp file,
    is there any other way to store the jpeg file in speciefied folder and view the jsp file

    Is there any other way to play the shuffle in a car if it doesn't have an aux facility???
    There is not.
    Or I wondered if you could play it through a smart tv...or do you need an apple tv box???
    Not with the Apple TV, but if the Smart TV has an AUX port, you can connect it that way.
    B-rock

  • My new iphone was stolen today. I'm trying to track it via icloud but it shows the average ratio that the phone is disconnected. Are there any other way to track the phone. Thanks for your help.

    my new iphone was stolen today. I'm trying to track it via icloud but it shows the average ratio that the phone is disconnected. Are there any other way to track the phone. Thanks for your help.

    If the phone is turned off, doesn't have an internet connection, or has been restored preventing "Find my iPhone" from being able to work, there is no other way to track it.

  • HT1310 do you have any programs that can hold the start up manager everytime when I turn on the computer?

    Do you have any programs that can hold the start up manager everytime when I turn on the computer?

    I am not sure but if they do have the way to do it, I would like to try. But I prefered the easy way  ^_^
    I do have intel iMac and the version of OS X is 10.9.1 .
    Thank you  so much

Maybe you are looking for

  • My wifi no longer works in my iPod after it got wet

    Does anyone have an answer to this.  I have already rebooted, Wiped clean the iPod and updated the software. 

  • Crashing on Mac When Trying to Import?

    I just installed the CS5 master collection on my Macbook today, and I have been having a weird problem with After Effects.  Whenever I go to import a video (File -> Import), the program will either freeze or crash.  The weird thing is, it's about hal

  • Pdf from jpg with OCR asks to "save to online account"

    Anyone know whether using OCR on Acrobat XI saves my data on Adobe server thru online account? When creating a pdf from jpg there is a toggle, "save to online account".  I prefer not to store my data in the cloud or on any server--I save only to my p

  • Weird frame on Desktop

    Hello, I noticed this morning that random links on websites were not working and then the scrolling feature on my mouse was screwy and then I get this thing that looks like scrapbook corners arranged in a frame that I can move around the desktop but

  • How can I keep my ipad3 screen brightness from fading while I am reading?

    I notice that as I am reading on iPad 3 the screen brightness fades every couple of minutes. Is there a way I can keep this from happening?