How to include stmt cases in a group by clause

Hi I have a question,

How can I include a case statement in the group by clause?

For example:

Select
(case when x.ctry is null then y.ctry to another x.ctry end) as chief operating officer.
sum (x.in_amt)
Of
tbl1 x,
TBL2 y
where
x.ID = y.id
Group
(case when x.ctry is null then y.ctry to another x.ctry end)

Assume, I had millions of records in the tables, then my guess is, the above query could take huge time.

Any other way to do it?

CD / wrote:
To delete the expression in the GROUP BY clause. I'm advocating no improvement in performance, I don't have?

No, you didn't. And your advice can remove in fact the expression in the GROUP BY clause. But I am still confused as to why this would be an end in itself.

Kind regards
Rob.

Tags: Database

Similar Questions

  • How to develop and reduce lines or groups of lines in figures?

    How to develop and reduce lines or groups of lines in figures?

    Thank you

    Casey

    Select the rows (or columns):

    Then, place the cursor on one of the row headings (the numbers on the left):

    so that you see the carat facing downwards, then click here to bring up the context menu for the lines:

    then select "hide selected rows.

  • How to remove the case of Tecra A3X

    Hello

    Could someone tell me how to get the case apart on my laptop?
    I took all the screws and it still won't fall apart.

    The problem is that following machine does not start.
    I removed the hard drive and it works fine in another machine, so im thinking that it might be the on-board battery?

    Mike
    Any answer welcome

    Hello

    Why do you think battery BIOS (RTC) failure?
    You get an error like "verification system. Then press F1? "

    If you do not receive this error message your RTC battery is ok!

    I think it is a very bad idea to disassemble the laptop, if you don't know what the problem is and how to do it!
    There is a high risk that you would harm other parts of the laptop.
    I think you should ask the ASP in your country to control the laptop!

    Good bye

  • How to open the case or take the panels on a desktop HP A6202

    How to open the case or take the panels on a desktop HP A6202

    Just a manual for the love of God or an image. Now I searched the Net for an hour - no luck

    See this guide HP titled "opening the box" for instructions on how to open the case. Be aware that there are several "HP a6202" computers and your may be different than what I have listed. Please provide the full name of the HP model and/or the product name of the computer in question during a request for assistance.

  • How to include LabView Instr.llb in a deployment of TestStand?

    I want to deploy my sequenze of testbed. When I install the deployment and you want to let it run it shows that it can t find all the sub whitch screws I used directly from LabView. For example: .vi VISA set up a Serial Port (Instr) or by check if file or folder Exists.vi. How to include this VI s to the installer?

    He s solved. This screw is located in the folder: Support screw whitch is createt automatically by the installation.  Thank you

  • How to add contacts to your existing groups or how to manage your groups?

    Anyone know how to add contacts to your existing groups or how you manage your existing groups. How do you even add new groups I can't find a way to do this in the ocntacts.

    Hello

    1. what version of Windows is installed on the computer?

    2 are. what groups you referring?

    3. What mail client do you use?

    If you use Hotmail, you can post your request in the Windows Live Forum.

     

    http://answers.Microsoft.com/en-us/windowslive/Forum/Hotmail

    You can check the link:

    http://Windows.Microsoft.com/en-us/Windows-Live/Mail-import-backup-restore

     

    Please get back to us with the above information so that we can help you accordingly.

  • How to open the case of a 15-g020ca hp?

    How to open the case of a 15-g020ca hp? I would like to replace the hard drive. The screws in the back seem to do nothing. It appears no release (or torque) seems them to have no effect on anything.

    Hello:

    Here is the link to the service manual for your laptop.

    http://h10032.www1.HP.com/CTG/manual/c04162986.PDF

    Read the applicable removal procedures section parts and replacement.

  • How to create a mailing list of group in Windows Mail

    I created 2 groups for more than a year, but can not find a way to do it again.  I opened "contacts" in windows mail, can not find 'create new group' anywhere.

    Hello

    These should contribute to a:

    How to create e-mail contact groups in Windows Vista
    http://www.vista4beginners.com/how-to-create-e-mail-contact-groups-in-Windows-Vista

    How to create a mailing list with Windows Mail
    http://www.ehow.com/how_4815283_mailing-list-using-Windows-mail.html

    Create groups of contacts (mailing lists)
    http://Windows.Microsoft.com/en-us/Windows-Vista/create-contact-groups-mailing-lists

    How to create and use a Contact Group in Vista
    http://www.Vistax64.com/tutorials/69738-contact-groups-Windows-mail.html

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • How to include the name of the vendor and the Version for the appliation

    Hello
    How to include the version and the supplier of the application/product we created. I have sucessfully signed the code file in the mobile, but now I want to include the version and application provider how to do this.

    If you suspect that other people have asked similar questions, then by searching this forum or knowledge base is the right thing to try.

    http://supportforums.BlackBerry.com/T5/Java-development/read-version-from-inside-app/m-p/345845#M638

  • BBM how to remove inactive members on BBM group

    Hi all

    I am admin and creator of a group. recently, I realized that on the list of the members of my group, there was an inactive member, I want to delete this but has always failed... I can't even see this inactive member.

    Does anyone of you faced this problem too? How to remove inactive members in the Group

    Thank you

    Sort:

    Ok thank you!

    I'll see what I can find and update this thread when I know more

  • How to include folders to D: drive, specifically in Documents public, not only in the document library?

    Windows 7 Pro 64 - bit SP1: how to include records of the D: drive in public Documents so that they become automatically visible to each user who opens his library of Documents? At present, I can only include these folders in the document library, invisible to other users. I don't want to load large files physically in the C: drive, where public Documents.

    You can do this easily because public Documents is a folder, not a library.

    You can place junction points in public Documents that point to folders on the disk D:\.

    To do this open a command prompt by typing cmd in the box to start the search, made a right click the program cmd that appears in the search results and click 'run as administrator '. Type the following command and press ENTER:

    MKLINK /J "C:\Users\Public\Documents\Folder" "D:\Folder.

    http://TechNet.Microsoft.com/en-us/library/cc770988 (v = ws.10) .aspx

    You may need to adjust the permissions of files and folders on the drive D:\ so that all users can have access to them.

    I have not tested it; so be cautious.

  • DV7 - 3067cl, how to open the case and clean the fan?

    Where to find a manual that shows you how to open the case to clean the fan?

    Thank you!

    Hello

    It is not easier to do component, but the procedure is detailed from on Page 94 of your & Maintenance Guide.

    Kind regards

    DP - K

  • How to include a message of output in a procedure

    Hi guys,.

    I have the procedure, where I need to include a query of exit message, please help me.

    The procedure is:

    create or replace procedure insert_data_employees (p_name in varchar2, p_acess_level in numbers) as

    v_Name varchar2 (100);

    number of v_uname;

    Begin

    If p_name is not null then

    BEGIN

    Select COUNT (1) in the v_uname of employees

    where

    Upper (p_name) = upper (name);

    Exception

    WHEN NO_DATA_FOUND THEN

    v_uname: = 0;

    END;

    End if;

    INSERT INTO employees

    (name, rol_id, emp_number, creation_date) VALUES

    (EMPLOYEES_DATA_SEQ,

    regexp_replace(p_name,'(.*)@.*','\1'),

    p_acess_level,

    SYSDATE

    );

    COMMIT;

    end insert_data_employees;

    If I write the query in the form:

    create or replace procedure insert_data_employees (p_name in varchar2, p_acess_level in numbers, some o_return_code number)

    How to include under conditions in the procedure? How can I represent the successful and failed integration in a query?

    a. If successful insertion, then o_return_code = 0

    b. If insertion failed so o_return_code = - 1

    Please help its urgent...

    You can use the cursor SQL SQL and FOUND for this % NOTFOUND attribute.

    create or replace procedure insert_data_employees(p_name in varchar2,p_acess_level in number) as
    v_name varchar2(100);
    v_uname number;
    Begin
    if p_name is not null then
    BEGIN
    select COUNT(1) into v_uname from employees
    where
    upper(p_name) = upper(name);
    Exception
    WHEN NO_DATA_FOUND THEN
    v_uname:=0;
    END;
    End if;
    INSERT INTO employees
    (emp_number, name,  rol_id, creation_date) VALUES
    ( EMPLOYEES_DATA_SEQ,
      regexp_replace(p_name,'(.*)@.*','\1'),
      p_acess_level,
      SYSDATE
      );
      IF SQL%NOTFOUND THEN
      o_return_code := 1;
        dbms_output.put_line('Records inserted');
      ELSIF SQL%FOUND THEN
        o_return_code := 0;
        dbms_output.put_line('Nothing inserted.');
    COMMIT;
    end insert_data_employees;
    

    I have not tested the code in my DB.

  • How to open the case of a HP Pavilion a1657c

    The fan of my graphics (nVidia) is extremely low. I read on the internet that some blowing dust out of the inside of the Tower will help this problem. The thing is, I can't get the thing open dang. I removed a few screws, but there is a kind of ring in the way and I can't find out how to remove or bypass it. Is there anyone who knows full instructions on how to open the case?

    ThelielFK wrote: my (nVidia) graphics card fan is extremely low. I read on the internet that some blowing dust out of the inside of the Tower will help this problem. The thing is, I can't get the thing open dang. I removed a few screws, but there is a kind of ring in the way and I can't find out how to remove or bypass it. Is there anyone who knows full instructions on how to open the case?

    Hello ThelielFK, here is the link that has information on how to access the system by removing the side panel.

  • How to include banner_edge.js in banner.html?

    Hi, my question is simple.

    How to include banner_edge.js in banner.html?

    Our server may not have this file separately for specific reasons.

    But we can give the file to an absolute address.

    edge_includes\edge.5.0.1.min guess a banner_edge.js


    Thanks for the quick replies

    Without doubt, I've solved my problem...

    change in html file

Maybe you are looking for

  • trouble with bookmarks

    When I open my favorites I can see them all very well, but when Ii scroll to the option toolbar bookmarks and it pops out I don't see any of them because they are all wearing masks. I can see all the small icons on the left very well, but all the wor

  • Drive HARD of Equium A200 is not recognized on other laptops Toshiba

    I had an A200 equim but it is now broken, I wanted to put my hard drive in an another Toshiba, I tried the A100 as a friend had one, but would not work. I have another friend who has an A300 that I'll try the weekend but don't know if it will work an

  • Server restarts after a bugcheck. The bugcheck was 0 x 00000050 (Windows 2003)

    Having problem with reboots on a virtual server with Windows Server 2003 SP2.Sometimes sometimes during the night and sometimes during the day, a week between sometimes and a couple of months. Cannot see logically for restarts, please help. See analy

  • Can not find the driver software for your device

    I have Windows Vista Home Premium (64-bit) SP2.Had a card just before SCSI Adaptec AHA-2940U/UW working in XP the operating system upgrade. -System sees this controller in Device Manager-Adaptec has Vista drivers download (32 - bit, 64 - bit no)-Down

  • Pearls of impossible to send blackBerry Smartphones, but can receive via enterprise server

    three separate beads, two on Vodafone and the other on the Orange network stopped being able to send emails, even if they can receive ok. I have suffered two own handsets, deleted their accounts on the server of the company. After awhile, I reapplied