Is it possible to group several columns individually without the help of the union?

Hi, if I have a table with a column numebr I want group, for example, sex, nationality, age and I want to present a summary of this kind:

County group
10 male
23 women
British 19
14 Irish
18 10

...
etc.

Or even better:
County group
10 men
Sex-wife 23
British Nationaility 19
14 Irish
10 to 18 years

Is it possible without using loads of trade unions? I just want to do the best way and most effective the table involved has > 100 million lines.

Thank you very much

Jen :)

Hey, Jen,

Here is another way, which could be faster because it does not unpivot data:

SELECT    CASE  0
           WHEN  GROUPING (gender)       THEN  'Gender'
           WHEN  GROUPING (nationality)  THEN 'Nationality'
           WHEN  GROUPING (age)         THEN 'Age'
       END                    AS label
,       COALESCE ( gender
               , nationality
             , TO_CHAR (age)
             )           AS val
,       COUNT (*)          AS cnt
FROM       t
GROUP BY  GROUPING SETS ( (gender)
                          , (nationality)
               , (age)
               )
ORDER BY  label
,            val
;

Output, using the data of knapen:

LABEL           VAL                    CNT
--------------- --------------- ----------
Age             25                       2
Age             30                       2
Age             40                       2
Age             45                       2
Age             50                       2
Gender          F                        5
Gender          M                        5
Nationality     BRITISH                  4
Nationality     INDIAN                   3
Nationality     IRISH                    3

Tags: Database

Similar Questions

  • Is it possible to save photos from lightroom without the original file?

    I recently imported photos into lightroom, but I did not back up the original files on my computer and they are deleted from my card.  The images still appear in lightroom.  Is it possible to save them from lightroom without the original file?

    Your images are not - and have never had - in Lightroom, they are just referenced in the Lightroom database.

    Lightroom generates jpeg previews of the originals, however, and you can export users export preview plugin of Rob Cole: robcole.com - PreviewExporter.

    To be clear, however, that are not originals.

  • Is it possible to convert a LWAPP AP without the upgrade tool

    I have a considerable number of access points to convert. All access points are new, so that they have the MIC of Cisco. So I should be able to just TFTP image on access points, but I can't find any info on this.

    It would be much faster for me that I could make dozens of AP at the same time, and I wouldn't have to deal with the upgrade tool quite flaky. Did anyone done this before?

    In fact you can do. The main goal of the upgrade tool is to generate a SSC and add the string SSC to the controller. If you have a microphone, the upgrade tool allows to bypass the process of generation of SSC and executes TFTP. You can telnet to an IOS AP and run

    "archive download-SW tftp://x.x.x.x/c1240-rcvk9w8-tar.123-11.JX1.tar.

    and the IOS AP basis during the restart will load the code base LWAPP, join the controller and improve itself to match the revision of the code of the controller. Now I don't know if this is supported, but your initial question was about the possibility. So yes, that it can be done without the upgrade tool, as long as you have an AP with microphone installed.

    Good luck.

  • How (if possible) to check several Applecare statutes at the same time?

    I have several assets (hundreds) I want to check the soap operas to reach purchase date, and when the warranty expires. The Web site to check this allows only one at a time so as you can guess, it would be painstakingly your time.

    Is it possible to check in bulk of serials to acquire this information?

    None that I know, and I suppose that if there was a way he could mention on the status page.

  • Is it possible to mark several custom components in the same namespace prefix?

    Hello

    I've referenced several .swc library in my Flex project. The problem is that what I realized, is that they do not have the same namespaces, so that I have set a separate for each .swc file label, such as my Application tag looks like this:

    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx".
    xmlns:test = "" some.namespace. * ""

    xmlns:Test2 = "" some.otherNamespace. * ""

    < / s:Application >

    In this example of a reference library components would be called by the prefix of the trial, while another reference library will be called by the prefix test2.

    I realize that the simplest solution would be to combine all the components into a .swc file, but it is important to separate the .swc files as it is (one of the reasons is that I don't have the source files for most of the .swc to merge together).

    So is it possible in Flex to define several namespaces for a tag prefix, or they are strictly a one-to-one relationship?

    Thank you

    Patrick

    No, the link I mentioned did not mention on the fusion of everything together, he mentioned on the unique prefix for all components in a .swc, if you have access to the source of the library, you can follow the steps mentioned in the link to get a unique prefix, or well, it's a bit impossible to do without access to the source.

  • Is it possible to have several page layout in the single document?

    Hi all

    I have a PDF file that contains 10 pages. I want to do the first three pages of landscape layout and the other 7 pages in Portrait mode, is it possible?

    Thanks in advance

    Farida kaid

    Sreejesh K V wrote:

    Hi all

    I have a PDF file that contains 10 pages. I want to do the first three pages of landscape layout and the other 7 pages in Portrait mode, is it possible?

    Thanks in advance

    Farida kaid

    Sure. Print the first three pages in PDF format in the landscape, seven in portrait, others then combine them in Acrobat, or by opening the first and insert pages from the second, either using the file > create PDF > from several files.

  • Is it possible to view several RSS STREAM at the same time, but also the tag each article, so you can easily know who feed it comes from?

    I have a bad setting to the top of my RSS. I'm trying to do a single folder, put several RSS feeds inside, view the output of each stream RSS feed in the main folder and add an identifier for each article that told me that he feed came in a blink of an eye.

    See below for a crudely photoshopped example of something like what I hope to accomplish.

    You can configure a filter for messages from tag based on their website link corresponding to the custom Content-Baseheader, as described in the guide. Then, you can create a virtual folder of saved search as a subfolder of the folder that contains subscription main power. The saved search folder criterion would be the specific tag; the file can have any name. In this way, see you all the messages of all streams in the main folder and can focus on a specific stream by selecting the saved search subfolder.

  • It is possible to export several storage spaces at the same time

    How can I simultaneously export multiple tablespaces with expdp and ORACLE DB 12 c?

    Yes, it's possible: read here: https://docs.oracle.com/database/121/SUTIL/dp_export.htm#SUTIL200

  • Not possible to store several fileReference object to the same table?

    Hi all

    I'm trying to store several fileReference object in a table. But whenever I have a new object each time push() artefacts which is already in the table gets set on the object later.

    I let the user selecting an image. Then I push the fileReference object selected in a table like my_array.push (FileReference (event.target));

    If I then executes a loop on 'my_array' to check he's glad I get the most recent pushed fileReference for each index object in the table.

    With an object pushed:

    1 Image1.jpg

    With two objects pushed:

    1 Image2.jpg

    2 Image2.jpg

    Anyone has any ideas on this?

    Thank you very much

    Hello

    Sorry for the delay.  You've probably discovered the answer to that now, but in case you do not have or someone else runs into this issue here is the code that should fix this:

    // Local Files
    private var fileList:Array = new Array();
    private var localFiles:FileReference = null; 
    
    private function browse(event:MouseEvent):void {
         localFiles = new FileReference();
         trace("[Browse] Using local files");
         localFiles.addEventListener(Event.SELECT, onLocalFilesSelected);
         localFiles.browse();
    }
    

    The problem is you have had one instance of localFiles, and while that you stored more than once in the table, when the reference has changed it performs all of the table.  Instead, I'm newing up a FileReference browse() service, so that we get a new each time.  I hope that makes sense.

    Chris

  • Possible to run several simultaneous processes form the pl/sql in the background

    Hello

    We have a procedure in the package in pl/sql that spend us in the year and the month of.

    Instead of running these processese serial

    Package.Procedure (201301);

    Package.Procedure (201302);  etc.

    wish I had these running simultaneously in additional.

    What is the best way to do it.

    Only way I can think is dbms_scheduler to run once only for each job

    Using oracle 11.2.0.3

    Thank you

    Looks like dbms_scheduler way to go.

  • only get a single photo on board contact despite the selection of several columns.

    When you select the photo and contact sheet then, there is only a single photo in the upper left column. Unable to get several copies despite the selection of several columns.

    The contact sheet shows only the photos you selected in the library before going to the page of Contacts.

    If you want to have multiple copies of the same image, you need to duplicate this image enough times so that you get the number you want on the contact page.  Select the thumbnail and use the key combination command + D to duplicate the photo.

    Select all duplicate images, and then go to the Contacts option in the printing process.

  • Is it possible to merge several websites of muse?

    My site has a lot of different pages, and he began to muse slow down a bit. Is it possible to create several sites muse and merge them when I publish them?

    If not,

    Is it possible to create several subdomains and have the my links go subdomains? If possible, I need to know how to have an image link to a subdomain.

    Thank you!

    You can publish multiple sites on the same FTP server, but you do not want to use folders separated for each "site" or the section of the site to avoid conflicts with the names of your page.  You would connect to these sections in your homepage to the 'main' sites as you would other pages on a site. We do not recommend this however as possible rather difficult to maintain.

    However, you may find that the new version of Muse CC out allows that there are has some improvements in the management of the site which is a large site that covers much more easy.  You can see the help in your current version of Muse and join the beta program to check these features in the current beta.

    See you soon,.

    Justin

  • Adjustment of the columns individually?

    I'm afraid I already know the answer to this question, and since I am unable to find an answer final current I thought I would ask...

    I was forced to use Word 2011 today, and the document has a table. I noticed that I could set columns individually (it's not pretty, but it works). Is it true that the Word can do something that indesign can't? Say it isn't so!

    Can adjust you columns individually without affecting the whole table? I know that you can hold SHIFT, then the setting but this sill affecting the entire column. I usually merge, split, split, merge, ect... Rinse, repeat.

    I am on a Mac in CS5. This is the subject of the 5.5?

    You can try this,

    Choose the text tool and double click in a cell, the insertion point will come within the cell,

    Now, go to the table > split cell vertically, it will divide the cell, and then you can move the single axis using the "Shift" key

    Merge cells that is not necessary.

  • several accounts GMAIL under the gmail, not the email app application.

    Wonder if it is possible to have several accounts gmail under the gmail app? It shows me only one, without the ability to add more (unlike my tmobile mytouch friends)

    also, I noticed that the gmail account that I have linked to the gmail app, is not listed under "communications" or under the "email" app

    thoughts?

    Ninjaap according to this, you cab have more than 1 gmail account. On the Droid, just type 'add account' of Gmail, but these indications for the backflip...

    https://Motorola-global-Eng.custhelp.com/cgi-bin/motorola_global_eng.cfg/php/enduser/std_adp.php?p_faqid=41210&p_created=1262804753&p_sid=xhsqsIWj&p_sp=

  • How to use several different sections of the same clip in the timeline?

    Hey, I used this tutorial as a reference for editing. I have my own equipment I want change, which includes several takes different. Is it possible to use several different sections of the same clip in the timeline? You know, like the good part of a certain record keeping. I appreciate any assistance. Thank you

    Post edited by: Kevin Monahan

    Reason: changed the title of best research opportunities

    I prefer to put the clip in the Source monitor Panel, then set the points and exit. From there you can simply drag the section of the element in the sequence.

    Or, you can make a subelement, the section will have a distinct element in the bins in the project Panel. You should always keep the original material, but now you can have real subitems to work if you prefer.

Maybe you are looking for