Select the case when several returnvalue? 20 D

Hello
I would like to know if there is a solution less than 10g for something like this

Select case when 'C' = 1
then
(select double 1,2,3,4,5)
on the other
(select double 6,7,8,9,0)
end
of the double.
(select 1 double 'C')

What I really need, is the full output of (select double 1,2,3,4,5) or (select double 6,7,8,9,0) If a State due to a different sql query is true or false. No matter if the solution uses 'case when' or anything else.

Thanks in advance for any help.
Best regards
Carsten

Something like this would work with the example you gave.

SQL> with test_data as
  2      (select 1 c from dual)
  3  select
  4      1, 2, 3, 4, 5
  5  from
  6      dual,
  7      test_data
  8  where
  9      c = 1
 10  union all
 11  select
 12      6, 7, 8, 9, 0
 13  from
 14      dual,
 15      test_data
 16  where
 17      c != 1;

         1          2          3          4          5
---------- ---------- ---------- ---------- ----------
         1          2          3          4          5

SQL> edi
Wrote file afiedt.buf

  1  with test_data as
  2      (select 2 c from dual)
  3  select
  4      1, 2, 3, 4, 5
  5  from
  6      dual,
  7      test_data
  8  where
  9      c = 1
 10  union all
 11  select
 12      6, 7, 8, 9, 0
 13  from
 14      dual,
 15      test_data
 16  where
 17*     c != 1
SQL> /

         1          2          3          4          5
---------- ---------- ---------- ---------- ----------
         6          7          8          9          0

Tags: Database

Similar Questions

  • doubt in the case when statement

    Hi the gems...

    I have a case when statement in a select clause... ago total three conditions in the case when statemnt.

    now my question is if all theconditions gets mapped, what happens?

    is only the first condition is executed and rest two is ignored or the third condition will overwrite the previous two?

    Please help... Thanks in advance...

    You can see it with:

    select case when 1=1 then 1
                when 2=2 then 2
                when 3=3 then 3
           end test
    from dual;
    
    TEST
    ---------
    1
    

    You get only the first result!

    Published by: hm on 18.11.2011 04:11

  • In version 13.0 is selected the option "when Firefox starts to show my windows and tabs from last time", but I always get default page of Firefox.

    Even thought is selected the option ' when Firefox starts to show my windows and tabs from last time "I always have the default page of Firefox.

    Hi Goldie_,

    I guess you don't watch this page when you closed Firefox last time. Also that you are not in private, correct navigation mode? Looks like it is maybe a problem with Firefox being able to save your file pref.js. You should try the steps listed in the preferences section that won't save trouble. Try and let me know how it goes.

    Hope this helps!

  • How can I prevent Pages 5.6.1 selecting the invisible when I change the text in bold, italic, etc. on a new line

    This is starting to annoy me a lot and I have not found something online that will solve this problem.

    Let's say I'm editing a file.

    Now I say "Oh, I need to put a"BOLD"two lines after the second 'Cogito ergo sum'"- so I go to this line and press Cmd + B (shortcut for "BOLD") and in this case:


    He selects the invisible! Now, let's say I write about it

    It disables the "BOLD"! What is the point of this? This makes me press the shortcut and then I have to press the arrow to the left. That you understand it's frustrating because it's a waste of 4 seconds, every time I want to change the style of the last line. And for someone who publishes an entire document, it is VERY frustrating.

    Can someone help me?
    I hope it's a clear description of the problem

    When you use the attribute text keyboard shortcuts, it's a good idea to show invisible, so that you know where click to place your insertion point - before selecting the keyboard shortcut. If you want to use these shortcuts, you must adapt to the way in which the Pages to do things and not try to make it work like MS Word.

    When you select the paragraph marks, the following keystrokes will remove them, right as well as your sense of humor.

  • GETVPN and regeneration of the keys when several members of the Group leave at the same time

    He did not specify how the key servers respond when several members of the group start simultaneously. For example, if 3 members leave the same group, made the key manager sends three keys (KEK, TEK) and only the last will be available for future connections? Or the key manager optimizes the regeneration of the keys and sends only a single key?

    Thank you

    Stone,

    On himself, he is not uncertain. You can retrieve the session memory keys (not impossible but difficult).

    I guess what you are looking for is a red button to clear the SAs on all devices?

    In this case:

    http://www.Cisco.com/en/us/docs/iOS-XML/iOS/sec_conn_getvpn/configuration/15-2mt/sec-get-VPN.html#GUID-6267F36C-094F-483F-A1CA-735D39484364

    Specifically "clear members ks gdoi crypto now."

    There is a particular risk that you thought?

    M.

  • WIN8 cannot select the user when connecting more

    I used to have the option to select the user to connect as but now I have a screen that says:

    Press Ctrl + Alt + Delete or use the Windows Security button to unlock

    When I hit Ctrl + Alt + Delete I get only the most recent user login.  If I hit the left arrow right top left of the image, I must return to the Ctrl + Alt + Delete screen.  There is no way I can see to select another user.

    If the current user remembers actually disconnect from the screen Ctrl + Alt + Delete I am taken to a login with a choice of the users screen.

    This used to work and I don't know if my 5 yo changed something or if a updated Windows did something.  But my wife and son both need to use this notebook so I really need separate accounts.

    I found a few long really complex stuff on the ' net on the definition of the strategy group and fiddle with the registry but I know my 5 yo did nothing like that.

    How do I change back?

    Dennis

    PS what is the "Windows Security button" anyway?

    I realized that I had recently installed Cisco AnyConnect VPN software to connect to the work.  Which of - installed and now life is still happy.  I will contact Cisco.

    Sorry for the short reply above.  Validation has been broken here earlier today and several machines at the same time making a response and a new post, I didn't type a bunch just to get the "Oops, something went wrong" again.

    Dennis

  • How to set the slider tool to select the tool when opening acrobat XI 11.0

    I need the tool to default to the Selection tool and NOT the hand tool slider when you open Acrobat XI 11.0

    Hi mkwillden,

    Once you select the "Select" tool any subsequent launches of the software should keep the 'selection' as default tool.

    If this isn't the case, you can specify the parameter registry here:

    HKEY_CURRENT_USER\Software\Adobe\Adobe Acrobat\11.0\Selection

    Change the data of aDefaultSelect to Select or by hand as requires it.


    Kind regards

    Rave

  • Select the case sensitive option: lack of keyword

    Hi guys,.

    I tried for awhile now all kinds of combinations, without him between the two, with him between, media, etc., nothing works.
    I always get the error lack of keyword.

    SELECT CASE salesprice
    WHEN 0 THEN (salesprice + 20)
    WHEN salesprice BETWEEN 0 AND 20 CAN (salesprice + 1,10)
    ELSE (salesprice + 1.03)
    Salesprice END as from the sale

    would be great if one of you sees the error.

    Try:

    select case
            when salesprice = 0 then (salesprice + 20)
            when salesprice between 0 and 20 then (salesprice + 1.10)
            else (salesprice + 1.03)
           end as salesprice
    from sales;
    
  • Select the layers when you export an Indesign book in PDF format?

    Hello

    I created a book consisting of separate Indesign files, each containing different languages. Each language is in a separate layer.

    Then, I created 4 different book, each of which contains about 5 files. This makes me 4 pounds with all the languages spread over different layers. When I export the book in PDF format, I would like to be able to select the language layer, so I can create a PDF file by language. I can open each file to hide all layers of language except the one I want to export, but it is a tedious job.

    I'm wandering if there is a faster way to export in PDF format each language without having to open and re - register each separate Indesign file.

    Thanks for all the comments.

    :-)

    Tom

    Why do you need to omit the French layer for a book in German?

    Just export all the layers.

    Then, in Acrobat, turn off the French (Italian, Spanish, English?) and leave Germany exposed.

    Save as "Meine tollen deutschen Buchmarkt.pdf.

    Then, turn off all the layers except the format, and then save it under "my book excellent francais.pdf.

    I promise you that no one outside of a very few people will ever know that diapers with other languages hidden there. Almost anyone who uses Acrobat knows there is to all layers. (Except the brilliant people on this forum)

  • Select the checkbox when redirect (for pages not linked)

    I was wondering if I can get feedback from some Eloqua users at the time select the checkbox redirect (for pages not linked) for hyperlinks.  Our IT tells us that we should always select him even, the page is already followed (i.e. we Eloqua tracking code in our site site Web, community and business blog).  Not sure if this will create no damage always select this check box for pages followed and not chained.  I don't know if the link points to a form, so that the field auto complete with contact data, we cannot choose the redirect box, otherwise the data will not be automatically fill.

    Let me know.  Thank you.

    We always recommend customers follow all the links also well - there is nothing wrong with it and it ensures that everything is tracked in your reports.

    Best,

    Lauren

  • Change the case on several documents

    Hello!

    I'm very new to scripting, and I have the following script that is "Upper" text and change for real uppercase. I work with ID CS 6 on Windows XP.

    The script works on a single document, if there is an open, if not, it asks for a file and process all INDD files in this folder.

    That's what I have:

    if(app.documents.length != 0){
        processDocument(app.activeDocument);
        alert("Done!");
        }
    else {
        _folder = Folder('~/Desktop').selectDlg("Select folder");
        if(_folder == null) exit();
        _files = _folder.getFiles("*.indd");
        if(_files.length == 0){
                alert("No INDD files in the selected folder!");            
            }
        else {
            for (i=0; i<_files.length; i++){
            app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
            _inddFile = _files[i]
            doc = app.open(_inddFile);
            app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;      
            processDocument(doc);
            app.activeDocument.close(SaveOptions.yes);
            } 
        alert("Done!");
        }
    }
    
    function processDocument(doc) {    
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.capitalization = Capitalization.allCaps;
        app.findGrepPreferences.appliedCharacterStyle = 'Red';
        var _results = doc.findGrep();
        app.findGrepPreferences = app.changeGrepPreferences = null;    
        _length = _results.length;
        for (i=0; i<_length; i++) {
            _results[i].texts[0].changecase(ChangecaseMode.uppercase);
            _results[i].texts[0].capitalization = Capitalization.normal;
            _results[i].texts[0].appliedCharacterStyle = 'Blue';
        }
    }
    

    The script works well on a single document, but for some reason any that it does not work on several documents. I try the script on 4 files with this content (the colors are added in the text only to help verify the results):

    Whenever the first or the first two documents are processed correctly, the others are not processed at all. But I get no error message. Where is the problem?

    Any help would be greatly appreciated!

    Luca

    I tried to recreate your problem once again and I don't have something similar. I know it's not normal, but mine started when I changed the variable i in the second. I see that they have a different scope, but somehow she made the difference. Could you try it by chance?

    #target indesign
    if(app.documents.length != 0){
        processDocument();
        alert("Done!");
        }
    else {
        _folder = Folder('~/Desktop').selectDlg("Select folder");
        if(_folder == null) exit();
        _files = _folder.getFiles("*.indd");
        if(_files.length == 0){
                alert("No INDD files in the selected folder!");
            }
        else {
            for (i=0; i<_files.length; i++){
            app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
            _inddFile = _files[i] ;
            doc = app.open(_inddFile);
            app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
            processDocument(doc);
            app.activeDocument.close(SaveOptions.yes);
            }
        alert("Done!");
        }
    } 
    
    function processDocument() {
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.capitalization = Capitalization.allCaps;
        app.findGrepPreferences.appliedCharacterStyle = "Red";
        var _results = app.activeDocument.findGrep();
        $.write(_results);
        app.findGrepPreferences = app.changeGrepPreferences = null;
        _length = _results.length;
        $.write(_length);
        for (s=0; s<_length; s++) {
            _results[s].texts[0].changecase(ChangecaseMode.uppercase);
            _results[s].texts[0].capitalization = Capitalization.normal;
            _results[s].texts[0].appliedCharacterStyle = 'Blue';
        }
    }
    
  • Mouse is to select the elements when I scroll in Flash Player.

    Every time I play a game using Flash Player and I put it in mode full screen my mouse will select items while using the scroll wheel.  If its in an area where there is nothing to select then it will zoom in and out, but as soon as the cursor is on something that can be selected it will choose.  This does not happen when I use the same application in the MS-edge browser or does it occur when I do the same thing under Windows 7.  So I think its something between Chrome and 10 of Windows, but I would check here if any have fact the thought experiment.

    I'm using Chrome version 51.0.2704.79

    Flash player 21.0.0.242

    Windows 10

    The mouse driver is updated as well. I swapped the mouse with the other and got the same effect.

    Well, I have more information.  This is a bug in Chrome.

    We reported here:

    Question 620974 - chrome - MouseDown event trigger for the fullscreen mouse wheel - Monorail

  • Select the list when the button display problem in Oracle Apex

    Hello world

    I use a button that displays a selection list box (contains two values) click on...

    Whenever the button is touched for the first time, the selection list box does not appear properly... the list box is displayed in a smaller size if the values it is not visible...
    However it appears correctly when I hit the button for the second time... its strange...

    Help, please!

    Kind regards
    Sandeep Reddy

    There are two options. One is to create a Page process that fires before header or after and sets the value of the element. This method works when the value is independent of the other page elements. If the value is dependent on other page items, you can set all at once in the same process.

    Example:

    declare
      var_field1   VARCHAR2(40);
    begin
      var_field1  := :APP_USER;
      :PX_USERNAME  := var_field1;
      select COUNT(row_id) into :PX_USER_COUNT from users;
    end;
    

    This example illustrates two ways to define the elements of the page: one using another variable and the other as a result of a pass-through select query. You can also use the function calls, the application variables and more.

  • syntax of log_file_name_convert in the case of several members to redo

    Dear Oracle guru,
    I'm doing a script rman duplication.
    on the target db I redo 3 groups each have 2 members on the different directory path. On les(different machine), the logs under/U01 will pass to the /ora1
    and / U02 will move to the /ora2


    /U01/oradata/prod/redo01.log
    /U02/oradata/prod/redo01b.log

    /U01/oradata/prod/redo02.log
    /U02/oradata/prod/redo02b.log


    /U01/oradata/prod/redo03.log
    /U02/oradata/prod/redo03b.log


    I know
    DB_FILE_NAME_CONVERT = ' / u01/oradata/prod / "," / ora1/oradata / to the /.

    What should be the proper syntax for log_file_name_convert

    I am looking for site to oracle but they just be listed in case 1 example

    log_file_name_convert = (< source_db_path >, < target_db_path >)

    should I use
    log_file_name_convert = ' / u01/oradata/prod / "," / ora1/oradata / to the / "," / u02/oradata/prod / "," / ora2/oradata / to the /.


    Thanks for your time...

    No, you cannot use log_file_name_convert in an RMAN execution block.

    But you have not :)

    Just put the conversion in the pfile/spfile file, start the auxiliary database in nomount mode and duplicate the database. Your conversion rules for log files are correct. You can collect both the logfile group members in directory a target on the side of the auxiliary.

    And Yes, you will get the same number of log files on Test as the Prod.

    HTH

    Joerg

  • "Control Click" to select the layer when it is in a group?

    You can keep the [Ctrl] key and click on an element in your document to select its layer. However, if click you on something that is within a group, the entire group is selected. Is there a way to get around this other that right click and selecting its layer in the context menu?

    What version of photoshop?

    CS 3: next to the check box, you can choose "group" or "layer".

    miss_marple

Maybe you are looking for

  • Qosmio X 300 not preforming well in games, trolling.

    Hey don't know how to say this, but I'm going.I play world of Warcraft and this laptop should preform very well in this game for its graphics card and ram Strip requirments by far.Well for a reason any its very slow and even if I turn down Details he

  • Windows Media Center will not install Internet TV

    I have Windows 7 Premium 32 bit running on my system.  I use to be able to use the Internet TV feature in Windows Media Center, but it has stopped working.  A few weeks ago, I had to reset to a previous system config and then tried to watch today.  H

  • Cannot print, images are not readable after the automatic updates.

    Original title 'Vista update' Last night my Vista has received an automatic update.  Now I can't print, and the image on my monitor is barely readable.  Thank you.  Now what?

  • HP 7520, how to print on banner paper

    I have a HP Photosmart 7520; Anyone know how to print on banner paper?

  • question of ListField remove the last element

    Hi all! Is there a known problem in ListField which explains the revival of an OutOfboundException when removing an element from a list with a single element? When you use listField.delete () I get this exception when the screen tries to set the focu