function box

Hi all

WITH xxc_data AS

(SELECT "America" ou_name, ou_cust_id "IBC"

OF THE DOUBLE

UNION

SELECT "America" ou_name, ou_cust_id 'IDC '.

OF THE DOUBLE

UNION

SELECT "America" ou_name, ou_cust_id 'BDS '.

OF THE DOUBLE

UNION

SELECT 'Australia' ou_name, "IBC" ou_cust_id

OF THE DOUBLE

UNION

SELECT 'Australia' ou_name, "IDC" ou_cust_id

OF THE DOUBLE

UNION

SELECT 'Australia' ou_name, ou_cust_id 'BDS '.

THE DOUBLE)

SELECT ou_name, ou_cust_id

OF xxc_data

WHERE ou_name = "America."

AND ou_cust_id IN ("IBC", "IDC", "COMICS")

UNION

SELECT ou_name, ou_cust_id

OF xxc_data

WHERE ou_name = 'Australia '.

AND ou_cust_id IN ('BIN', 'BDS')

output

OU_NAMEOU_CUST_ID
AmericaBDS
AmericaIBC
AmericaIDC
AustraliaBDS
AustraliaIBC

With the code above I will get results, if I add UNION I get 800 lines columns to insert only as below

Select

-200 columns

Union

Select

-200 columns

Union

Select

-200 columns


etc...


other than this union? Please help me

Post edited by: Rajesh123 has added new statement insert

Hello

Rajesh123 wrote:

create the table XXC_SAMPLE

(

OU_Name varchar2 (10),

ou_cust_id varchar2 (10),

OU_LINE1 varchar2 (10),

OU_LINE8 varchar2 (10)

)

insert into XXC_SAMPLE values('America','IBC',null,'Internal');

insert into XXC_SAMPLE values ('America','IDC', null, 'Internal');

insert into XXC_SAMPLE values('America','BDS',null,'Internal');

insert into XXC_SAMPLE values('Australia','IBC','Internal',null);

insert into XXC_SAMPLE values ('Australia','IDC', 'Internal', null);

insert into XXC_SAMPLE values('Australia','BDS','Internal',null);

and I used the code below

Select OU_LINE1, OU_LINE8

of XXC_SAMPLE

where ou_name in ('America', 'Australia')

and ou_cust_id ("IBC", "IDC", "BDS");

The actual data of the table is

OU_NAME OU_CUST_ID OU_LINE1 OU_LINE_6
America IBC Internal
America IDC Internal
America BDS Internal
Australia IBC Internal
Australia     IDC Internal
Australia BDS Internal

I 'IDC' in the two columns of ou_name, but I need below output

OU_NAME OU_CUST_ID OU_LINE1 OU_LINE_6
America IBC Internal
America IDC Internal
America BDS Internal
Australia IBC Internal
Australia BDS Internal

So, you want only 1 row of output with certain ou_cust_id values (for example, "IDC"), but for other values of ou_cust_id you want more lines output because there are lines of input.  What is the problem?

Why do you want the line with ou_name = 'America', rather than 'Australia '?  Do you want the line containing the first ou_name (in alphabetical order)?

If so, here's a way to do it:

WITH got_r_num AS

(

SELECT x.*

ROW_NUMBER () OVER (PARTITION BY ou_cust_id

ORDER BY ou_name

) AS r_num

OF xxc_sample x

WHERE ou_name IN ("America", "Australia")

AND ou_cust_id IN ("IBC", "IDC", "COMICS")

)

SELECT *- or the list of all columns except r_num

OF got_r_num

WHERE ou_cust_id IN ('BIN', 'BDS')

OR r_num = 1

;

Tags: Database

Similar Questions

  • Some of function boxes are elongated and may not reach the OK box

    original title: Windows Vista - Control Panel customization to enlarge the font size.  Some of function boxes are elongated and may not reach the OK box

    Using Windows Vista. I used the customization Panel control to enlarge the font size.  I discovered that some boxes, like Adobe Reader Print and function, in effect, the Personaization (to reduce the font size to original size) require a click OK. But the box frame with large font size, is elongated until I can't get the OK.  How to get to the OK or reduce the size of the police without the OK?

    Simply press enter instead of OK.

  • How to invert the function box?

    So I have a checkbox at the bottom of this page http://www.milesmemorials.com/product-GH54.html that once marked another form appears, but how can I get the form to disappear again if the box is unchecked?

    Also why isn't java script validation does not work for this form?

    Name:

    Tel:

    E-mail:

  • Function box XQuery tag?

    Hello

    We currently use DBMS_XMLQUERY to create complex XML of a type of object files and nested, we have created. Unfortunately, it seems that DBMS_XMLQUERY isn't the best way to do it, Oracle 11 g XML guide of the developer of the points that we should use DBMS_XMLGEN instead. This isn't an alternative, because it seems that XMLGEN doesn't have the 'setTagCase' of XMLQUERY function and the resulting XML doc gets all tags uppercase, which is apparently a big no-no is.

    I've been playing with XQuery today to see if it can work as an alternative, but I'm stuck at the same point. I can't find any way to have lowercase tag names. I tried with fn:lower - case, but it defines the cases for the whole of the contents of the object, not only the tags (also, it seems not even work with my type of object... it sets the values to lowercase AND removes the tags, go figure). I can't find any answer to this anywhere. Does he know something easy to do?

    This is the query that I use:

    Select (xmlquery
    ' for $j in 1 back
    (for $i in ora:view("TAB_OBJ_INMVAL") /ROW
    return (< something > {$i / COL_OBJX_INMVAL} < / something >)
    )'
    BACK CONTENT
    )
    of the double
    /

    Thank you!

    Well, you can even do it with a single SQL query directly from the table:

    SQL> select xmlserialize(document
      2           xmlquery(
      3            'declare function local:transform($e as element()) as element()
      4             {
      5               element {lower-case(name($e))}
      6               {
      7                 $e/@*
      8               , for $c in $e/node()
      9                 return if ($c instance of element())
     10                        then local:transform($c)
     11                        else $c
     12               }
     13             }; local:transform(*)'
     14            passing xmltype(col_objx_inmval)
     15            returning content
     16           )
     17           as clob indent
     18         ) as xml_output
     19  from tab_obj_inmval
     20  where usuario = 'DEV'
     21  ;
    
    XML_OUTPUT
    --------------------------------------------------------------------------------
    
      
    02/12/11
    1 Item #1 12 2 Item #2 99 3 Item #3 1456

    And on 11.2.0.3, with XQuery Update Facility:

    select xmlserialize(document
             xmlquery(
              'copy $d := /*
               modify (
                 for $i in $d/descendant-or-self::*
                 return rename node $i as lower-case(name($i))
               )
               return $d'
               passing xmltype(col_objx_inmval)
               returning content
             )
           ) as xml_output
    from tab_obj_inmval
    where usuario = 'DEV'
    ;
    
  • Syntax of the function BOX when multiple values equals the same result?

    I tried using the key word 'IN' with the CASE function, but it does not work, each case must be indicated separately? trying to save a few lines...

    has tried:

    case me607.rmc_code
    When to (',' MS', 'MP') then 'H311.
    end as carrier_code

    What I do:

    case me607.rmc_code
    When'm ' then 'H311.
    When "MS," then "the H311.
    When 'MP' and then 'the H311.
    end as carrier_code,
    etc...

    Thanks for any help...
    case when me607.rmc_code
     in ('M','MS','MP') then 'H311'
    end as carrier_code
    

    Max

  • My "connection Web site info remember function" doesn't recognize/save new password to Yahoo mail

    I just changed my password in my Yahoo email account - however, the login site Web Foxfire data do not forget the function box appears to ask you if I want to record my new login information.

    I checked my info to Tools/Options/Security and everything is as should be... And my box in Tools/Options/life private/Remember history is also checked...

    In fact the box "remember password data" just popped up when I registered on this site and my new connection info added to my list of saved login ID and passwords...

    Seems to be the "user name remember function" is not recognizing my password Yahoo mail login as new info change that needs to be recorded...

    Hello bthrower, Web sites can specify whether browsers should be able to save the name of user and password (through the AutoComplete = "off" attribute in the login form in the html source code)-it is often the case when a high level of security is probably held by these sites.

    You can either install an addon or use a bookmarklet to work around this restriction.

    Usernames and passwords are not saved

  • Case function can be used as a parameter when calling a procedure, please advise...

    Case function can be used as a parameter when calling a procedure, please notify

    The daily procedure is called with the parameter 3 following one of the parameters using a function box between them as shown below.

    Daily_Ins (c1.p_mtrid, c1.p_UOM CASE WHEN "KWH" THEN 1 ELSIF 'KW' THEN 2 END, v_dateHold);

    In my opinion, using decode is illegal, so I think that I cannot say something like :

    Daily_Ins (c1.p_mtrid, ( decode c1.p_UOM, "KWH", 1 'KW', 2), v_dateHold);

    I think I just found something on the net

    SQL > DECLARE

    2 wages NUMBER: = 20000;

    3 employee_id NUMBER: 36325 =;

    4

    5 PROCEDURE give_bonus (emp_id in NUMBER, bonus_amt number) IS

    6 BEGIN

    7 DBMS_OUTPUT. Put_line (emp_id);

    8 DBMS_OUTPUT. Put_line (bonus_amt);

    9 END;

    10

    BEGIN 11

    12 give_bonus (employe_id,

    13 CASES

    14 salary when > = 10000 AND salary<=20000 then="">

    15. WHAT salary > 20000 AND salary<= 40000="" then="">

    16. WHAT > 40000 salary THEN 500

    17 0 OTHERWISE

    18 END);

    END 19;

    20.

    PL/SQL procedure successfully completed.

  • Allow the user to choose the background color of dialogue/pallet box

    Hi all

    So, basically, I'm trying to give the user the ability to customize a toolbar, I developed for work by allowing them to choose their own color. I don't want to have to keep jumping into the script whenever someone wants a different color then thought it would be an additional pleasure.

    I looked and found the code for a color picker and suitable for what I want, but being a complete noob, I

    (a) clearly hurts because it does not work and

    (b) there is probably a better way to do it.

    You will see below my script for a fake dialog window.

    Any help would be greatly appreciated.

    var box = new Window("dialog", "Just Digital Toolbar");  
      
    box.panel1 = box.add('panel', undefined);  
    box.panel1.group = box.panel1.add('group', undefined );  
    box.panel1.group.orientation='row';  
      
    box.panel1.group.finalBtn = box.panel1.group.add('button',undefined, "Dummy 1", {name:'dummy1'});  
    box.panel1.group.binderBtn = box.panel1.group.add('button',undefined, "Dummy 2", {name:'dummy2'});
    box.panel1.group.bocBtn = box.panel1.group.add('button',undefined, "Dummy 3", {name:'dummy3'});
    
    
    box.panel2 = box.add('panel', undefined);  
    box.panel2.group = box.panel2.add('group', undefined, );  
    box.panel2.group.orientation='row';  
      
    box.panel2.group.colourPickBtn = box.panel2.group.add('button',undefined, "Colour Picker", {name:'colourPick'});
    box.panel2.group.closeBtn = box.panel2.group.add('button',undefined, "Close", {name:'close'});
    
    
    box.location = [1850, 40];
    
    
    box.panel2.group.colourPickBtn.onClick = function(){  
        
    var hexToRGB = function(hex) {
      var r = hex >> 16;
      var g = hex >> 8 & 0xFF;
      var b = hex & 0xFF;
      return [r, g, b];
    };
    
    var color_decimal = $.colorPicker();
    $.writeln(color_decimal);
    
    var color_hexadecimal = color_decimal.toString(16);
    $.writeln(color_hexadecimal);
    
    var color_rgb = hexToRGB(parseInt(color_hexadecimal, 16));
    $.writeln(color_rgb);
    
    var color_that_ae_add_solid_understands = [color_rgb[0] / 255, color_rgb[1] / 255, color_rgb[2] / 255];
    $.writeln(color_that_ae_add_solid_understands);
    
    box.graphics.backgroundColor = color_rgb;
    }
    
    //===================TEMP CLOSE FUNCTION=====================//
    box.panel2.group.closeBtn.onClick = function(){  
      box.close();
    }
    //===================TEMP CLOSE FUNCTION END=====================//
    
    box.show ();
    

    The piece of code I posted was intended to replace box.graphics.backgroundColor = color_rgb;

    Full code (without the .writeln of $):

    function hexToRGB(hex) {
        var r = hex >> 16;
        var g = hex >> 8 & 0xFF;
        var b = hex & 0xFF;
        return [r, g, b];
        };
    
    var box = new Window("palette", "Just Digital Toolbar");    
    
    box.panel1 = box.add('panel', undefined);
    box.panel1.group = box.panel1.add('group', undefined );
    box.panel1.group.orientation='row';    
    
    box.panel1.group.finalBtn = box.panel1.group.add('button',undefined, "Dummy 1", {name:'dummy1'});
    box.panel1.group.binderBtn = box.panel1.group.add('button',undefined, "Dummy 2", {name:'dummy2'});
    box.panel1.group.bocBtn = box.panel1.group.add('button',undefined, "Dummy 3", {name:'dummy3'});  
    
    box.panel2 = box.add('panel', undefined);
    box.panel2.group = box.panel2.add('group', undefined, );
    box.panel2.group.orientation='row';    
    
    box.panel2.group.colourPickBtn = box.panel2.group.add('button',undefined, "Colour Picker", {name:'colourPick'});
    box.panel2.group.closeBtn = box.panel2.group.add('button',undefined, "Close", {name:'close'});  
    
    box.location = [1850, 40];  
    
    box.panel2.group.colourPickBtn.onClick = function(){
        var g = box.graphics;
        var color_decimal = $.colorPicker();
        if (color_decimal>=0){
            var color_hexadecimal = color_decimal.toString(16);
            var color_rgb = hexToRGB(parseInt(color_hexadecimal, 16));
            var color_that_ae_add_solid_understands = [color_rgb[0] / 255, color_rgb[1] / 255, color_rgb[2] / 255];    
    
            g.backgroundColor = g.newBrush(g.BrushType.SOLID_COLOR, color_that_ae_add_solid_understands);
            };
        }  
    
    //===================TEMP CLOSE FUNCTION=====================//
    box.panel2.group.closeBtn.onClick = function(){
      box.close();
    }
    //===================TEMP CLOSE FUNCTION END=====================//  
    
    box.show ();
    

    Xavier

  • Help with a case function

    Hello

    I want to create a function box where column2 is based on the value of Column1.

    For example, the table below

    On the underside, I would ask something like

    Select status, description, l3_days, (case when status = 'Open' and DEV_DAYS = null THEN L3_DAYS = 'LOGIN_DATE-SYSDATE' WHAT status = 'open' and DEV_DAYS! = NULL THEN DEV_DAYS = L3_DAYS ELSE LOGIN_DATE-L3_DAYS-SYSDATE, DEV_DAYS END)

    support.jpg

    Not sure so clearly. Basically, I want to L3_DAYS and DEV_DAYS to be updated automatically based on the login_date. I plan to add a DEV_START_DATE column, which would facilitate the calculation of DEV_DAYS

    In any case I want to know how to write a case function, where denotes Column1 Column2?

    Thank you

    There are two CASE statements like this

    select status
         , description
         , case when status = 'Open' and dev_days is null then LOGIN_DATE-SYSDATE
                else l3_days
           end l3_days
         , case when status = 'Open' and dev_days is not null then LOGIN_DATE-L3_DAYS-SYSDATE
                else dev_days
           end dev_days
    

    If this isn't what you are looking for you need to explain your best condition. Provide a CREATE TABLE script and INSERT a TABLE for examples of data and provide a few example expected output.

    Also please read Re: 2. How can I ask a question on the forums?

  • Text box disappears after having reversed a movieclip?

    As the title indicates, the text that was created in a function box disappears after returning (scaleX = - 1). Is it possible to fix it? The text box contains the value of health, and it belongs to a unit of the enemy. When the enemy turns to face another direction, the text box disappears.

    Here's my function.

    private void draw (): void

    {

    healthTxt = new TextField();

    healthTxt.defaultTextFormat = new TextFormat ("Rockwell", 15, 0xFF0000, 1).

    healthTxt.height = 20;

    healthTxt.width = 20;

    healthTxt.x = - 10;

    healthTxt.y = - 28;

    healthTxt.text = health + "";

    addChild (healthTxt);

    ;

    }

    Everything has been properly instantiated. Any help would be appreciated. Thank you!

    If the device contains the textfield object, then the object textfield will turn with the device.

  • Suddenly, I have no back button and an additional toolbar

    When I came this morning and open Firefox 4.0b.11 seems to have a rather strange set up. I've got the normal top blue bar that I normally see on all applications in windows, with the Red Cross, minimize, maximize. Then below, I see the blue bar that I show on my netbook, which has the ED x, minimize, maximize and then an omni-menu orange. Under that, I have the file menu.

    I would like to make the blue bar in the Middle, with the omni-menu orange go away.

    I also lost all followed with my back button. There's just the gray and I cannot go back to her, or right-click.

    edit: my panorama is a mess too. It is to turn off all windows in space by themselves, duplication of containers without any function (boxes of Plains that behave as if they aren't there). My windows appear black rather than with glimpses, when I open new tab in panorama, they don't show up, and he shows me the latest panorama series, I was, until I have to manually go in and open a new tab in the browser window, then it jumps me in the other set of panorama, and the tab I opened in panorama is there after that.
    edit: my large windows are some tabs, but when I enter in a tab, the actual tabs that are displayed on my tab bar do not match.
    edit: I have no reloading either button or click right-reload and the URL bar does not appear the right URL when I switch tabs.

    I can reload the tabs by right-clicking on them yet.

    Sorry, I have to switch him back to FF3.6 for the day; I am a web developer and a lack of the button refresh kills productivity.

    Create a new profile exclusively for version 4.0 beta and create a shortcut on the desktop with Pei 'profile' attached to the target to launch this profile.

  • pulse wave simulated

    Hello

    I try to count the edges of the wave, or simply if a square wave goes from 0 to 1. However, I don't want to use the built-in meter to data acquisition. I want this to be purely software metering without using data acquisition. When I try to detect the edges with a Subvi I use, it will work until the frequency is high enough and it will not detect the edges. I'm not sure how to count the edges from there. I tried to use a function box and saw the increase in the real part when he was 1, however it would be permanently as long as the signal was high.

    Thank you

    I thought about it without your help. Thanks for nothing!

    Have a great day!

  • reset of incremental encoder

    Hello, this is a simulation using Labview 2011 years USB-6009.
    the table contains X (angle of encoder incremental counting rising edges) and Y (distance of linear encoder simulated with random numbers).
    The wheel is gradual and must be zero so every 360 points (X), the XY graph must be refreshed to show the last values 0-360.

    Nickname:
    If count > 360 then set I = 0 and turn, write another 0-360 array and record all comparison tables

    Question:
    Is a function box to use or two nested for loops with 2 counters, one up to 360 and the other until the overall value?

    In normal programming, I would divide the total number of 360, if the remainder is zero, then I would reset the meter I have zero, but I don't know how to "translate" in Labview.
    Thanks for the suggestions

    George

    Some points to note:

    feanorou wrote:

    Nickname:
    If count > 360 then set I = 0 and turn, write another 0-360 array and record all comparison tables

    Since 360 = 0 the code must be: If count > = 360... 0-359, 9-small but mean difference

    The function you're looking for is the

    Quotient and remainder function

    Have the Palette: Digital features

    Request: Basic package

    Calculates the whole quotient and the rest of the entries.

    Another useful thing is the shift register (see the tutorial of LabVIEW) you can use in your loop to keep a tachometer. Every time that Exchange (increase) you can save the update etc.

  • Windows Update text is small and faint grey and barely readable.

    XP operating system. After pulling of Microsoft Update the blue heading is not serious... but all the other texts, including necessary download titles and descriptions, check boxes, etc., are a small light color grey and extremely difficult to read.  The page/program is functional: boxes can be ticked and options downloaded OK. Just can not read. What is the problem please?  This problem is evident ONLY with Windows/Microsoft update. Thank you.

    Hi Warbler II,

    1 when was the last time it was working fine?

    2. did you of recent changes on the computer?

    3. what version of Internet explore that you use?

    Check if the size of the text of the Web page in Internet explore is set to medium.

    To change the size of Web page text

    1. open Internet Explorer by clicking theStart button, and then click Internet Explorer.

    2. click the button of thePage , click on text size, and then click the size you want.

    If the previous step fails, then reset the settings of internet explore by default and check.

    For more information please visit the link below.

    How to reset Internet Explorer settings

    http://support.Microsoft.com/kb/923737

    Important: Reset Internet explore its default configuration. This step will disable also any add-ons, plug-ins or toolbars that are installed. Although this solution is fast, it also means that, if you want to use one of these modules in the future, they must be reinstalled.

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • 1059 Error - cannot get 11 channels of data written in the spreadsheet file

    Hello everyone

    Again, it's Luke. I got the 7 fixed error, missing just a specific filepath to save data too.

    I now hit another snag along the way. When I enter data into a spreadsheet box writing, an error comes up saying "error 1059: unexpected file type".

    Anyone have any idea why its doing this?

    The only things that I put in the function box is some specific data on 2 GPS units I use, with a tension from my DAQ and the installation of strain gauges. Information works on my front and information is coming through, but will not save the data in a spreadsheet file, and writes a .lvm file will not work either.

    I will surround a printscreen of the configuration for the block diagram:

    Ohm Man wrote:

    I'm not sure of the exact file extension

    How do you define it?

    You set under whatever file name you put in your control filepath.

    I don't think it makes sense to get an error that says for attempting to write to a text file.

    Any chance you try to write the file to a path that you have not the full access rights to?  I think the error may be 1059, but it's actually be caused by a file windows error.  How about some strange characters in the name of the control that are not valid in Windows file?

Maybe you are looking for