Conditionally Formatting One Column Based On The Value of Another Column

I have the following requirement:
I have 2 columns in a report showing Actual Sales & Budget Sales each year. I am using a bar chart to show the different values for these 2 columns.
I need to conditionally format the column "Actual Sales" so that if it is less than the "Budget Sales" it will appear in red, and green if "Actual Sales" is greater than "Budget Sales." So in a nutshell,
CASE WHEN "Actual Sales" < "Budget Sales" THEN
RED
ELSE
GREEN
END
Thoughts anyone?

CASE WHEN (COL1 - COL2) < 0 then Red else Green end
regards
John
http://obiee101.blogspot.com

Similar Messages

  • Display an exception on one keyfigure based on the value of another key fig

    Hello all,
    How to run a exception based on some condition i.e
    i want to highlight the sales(key figure) which r less than the  average sales..
    where sales and average sales r keyfigures...
    i also created a cal key fig which has has value 1 if sale > avg sale...
    i.e How do i display an exception on one keyfigure depending on the value of another keyfigure??
    plz reply its urgent...
    thnx in advance...

    Hello Ajay, did you got an answer for your problem? I'm interested...
    Thx Masen
    Edited by: Masen-Fuad Marei on Nov 25, 2009 6:26 PM

  • Update one column while getting the value in another column

    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.

    jsun wrote:
    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.Two statements != two database calls.
    At least not in terms of SQL.
    JDBC requires a 'statement' but in SQL (depending on the data source) that can include multiple statements. An obvious example of this is a stored proc but there are other ways as well.

  • How to modify F4 help of one parameter based on the value of another?

    Hi,
    My Query is as follows:
    I have 3 select-options / parameters on the selection screen.
    If I enter some value in the first parameter the values in the second parameter should reflect accordingly.
    For example: The 3 selection-screen parameters are:
    select-options: s_werks for pa0001-werks no intervals,
                          s_btrtl for pa0001-btrtl no intervals,
                          s_kostl for pa0001-kostl no intervals.
    On exceuting the report, say I do a F4 and select '1000' for the first parameter (s_werks).
    Now after selecting the value for the first parameter if I do a F4 on the second parameter (s_btrtl) then it should prompt me with a F4 help containing values only corresponding to '1000' entered in s_werks and not all the values maintainined for btrtl.
    I have tried AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_BTRTL-LOW.
    And then used the FM F4IF_INT_TABLE_VALUE_REQUEST.
    But At Selection-Screen On Value Request the selection screen parameter s_werks does not show any value. It reflects the value only once it reaches Start-of-selection.
    Can anyone please guide me how to go about it?

    hi
    Please do it in this way..
    TABLES: pa0001.
    select-options: s_werks for pa0001-werks no intervals,
    s_btrtl for pa0001-btrtl no intervals,
    s_kostl for pa0001-kostl no intervals.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_BTRTL-LOW.
      PERFORM sub_pop_btrtl .
    *&      Form  sub_pop_btrtl
          text
    -->  p1        text
    <--  p2        text
    form sub_pop_btrtl .
    DATA :  l_wa_dynp TYPE dynpread,
            l_i_dynp TYPE STANDARD TABLE OF dynpread,
            l_wa_temp LIKE LINE OF S_werks.
    REFRESH s_temp[].
      l_wa_dynp-fieldname = 'S_WERKS-LOW'.
      APPEND l_wa_dynp TO l_i_dynp.
    Get the screen values of template
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = l_i_dynp
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc <> 0.
    Do Nothing
      ENDIF.
    Put the screen value in the select-options
      READ TABLE l_i_dynp INTO l_wa_dynp INDEX 1.
      l_wa_temp-sign = 'I'.
      l_wa_temp-option = 'EQ'.
      l_wa_temp-low = l_wa_dynp-fieldvalue.
    Now you use l_wa_temp as plant field
    endform.                    " sub_pop_btrtl

  • Making a new column out of the values from another column

    I am trying to query the transaction table and the promotion table to get the following output..
          select t.no, t.date,p.groupid,p.promocode,sum(t.salesamt)
          from trans t, promo p
          where t.id=p.tid
          group by t.no,p.groupid,p.promocode,t.date
          order by t.date
    no
    date
    groupid
    promocode
    promodesc
    sum(t.salesamt)
    m12
    01-jun-2012
    09
    p12
    Promotion1
    7890.00
    m12
    01-jun-2012
    09
    p13
    Promotion2
    345.56
    m12
    01-jun-2012
    09
    p14
    Promotion3
    2345.90
    m12
    01-jun-2012
    09
    p12
    Promotion1
    345.12
    m12
    01-jun-2012
    09
    p13
    Promotion2
    23678.00
    m12
    01-jun-2012
    09
    p14
    Promotion3
    3456.78
    I want to remove the promodesc and the sum(t.salesamt) and add Promotion1,Promotion2,Promotion3 as three new columns and their respective sum(t.salesamt) as their data value.
    I am thinking about using three separate case statements to achieve this...
    sum( case when promocode='p12' then t.salesamt end) Promotion 1
    Please let me know if there is any other optimal way to achieve this.
    Thank you!

    Hi,
    What you want is called a Pivot.  Using CASE expressions (like you described) is one common way to do pivots.  If you're using Oracle 11.1 (or higher) then you'd probably want to use the SELECT ... PIVOT feature instead.  See the SQL Language manual
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#sthref6809
    and the forum FAQ
    https://forums.oracle.com/message/9362005
    for details and examples.
    If you get stuck, post your best attempt, along with CREATE TABLE and INSERT statements for a little sample data, and the results you want from that data (if different from what you've already posted).
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Set the css style of text in a column according to the value of another col

    I'd like to set the css style of text in a column according to the value of another column. Each field may end up with a different style of text as a result, for instance.
    Any ideas? I looked thru the forums but couldn't find anything.
    Thanks,
    Linda

    Does the class=”t7Header” make it into the rendered HTML?
    ---The text "class="tHeader" does not show but the other text is rendered using the style t7Header as defined in the stylesheet! Exactly what I wanted.
    You might want to use a div or a span instead of a p.
    ---Yes -
    What's very cool is we can create a display column that is dynamically filled with the html and style wrappers based on a lookup to see what style should be applied according to the actual data value. This is critical as our tables are all dynamic so I can't depend on using the additional APEX methods to control the display of a column (as the # of columns in the view vary from instance to instance) and I did not want the display specs to muddy up my SQL queries.
    I wonder why this is not well documented. It is so easy!
    Thanks again for your help.
    Linda

  • Setting the Link Group Name in  Deep Link based on the value of a column

    Using Jdeveloper 11g, Jheadstart 11g
    Is it possible to override the link group name in deep linking. For example can I conditionally set that field based on the value of the item.
    Regards
    Edited by: aliegeh on Jul 25, 2010 8:35 AM
    Edited by: aliegeh on Jul 25, 2010 8:43 AM

    Thanks for the suggestion.
    Here is what I am trying to do:
    I have a table with one visible column that has the following entries:
    1. Create
    2. Modify
    3. Verify
    4. Approve
    5. View
    If the user clicks on row 1 (Create) then the link group name should be "CreateEmployees" to create new employees
    If the user clicks on row 3 (Verify) then the link group name should be "MaintainEmployees" for verification and so on.
    (This is role based and each role will have access to one or more of the rows in the tabler)
    It basically mimics a work-flow type of scenario.
    I tried to modify the template and looked at the line:
    action="$JHS.facesConfigGenerator.addItemGroupLinkTaskFlowCall((${JHS.Current.item})}" but got stuck there.
    Is there a way to change "JSH.current.item" in the template to read the group link name from another column say by using #if statements.
    One way I also tried was to introduce a column for each action such as CreateAction, VerifyAction etc which kind of agrees with your suggestion but the drawback is the need to modify the table if another task is required.
    Regards
    Edited by: aliegeh on Jul 25, 2010 8:36 AM
    Edited by: aliegeh on Jul 25, 2010 8:42 AM

  • Validating an attribute based on the value of another while inserting

    Hi guys
    I need to validate an attribute based on the value of another attribute.
    Example:
    inside some entity I have the following validation function
    public boolean validateAtt1(Number data){
         if (this.getAtt2() < some vlaue)
              return false;
         return true;
    this function works fine when I'm updating a record, but when I'm inserting a new record the this.getAtt2 return null, now I don't want to override the validateEntity function I want to override the validate function for att1; so in other words is there a way to reach att2 in the validation function of att1 when I'm inserting a new record, because the this.getAtt2() returns null if I'm inserting a new record.

    Using attribute-level setter methods won't work because when the value of a particular attribute is being set, the values of the other attributes might not yet have been set. This explains for example why it does not work when inserting a new record. You therefore have to validate at entity level.
    Rather than coding on the validateEntity() method you use a built-in Validator or Method Validator. When recording validators like this, you can provide a separate message for each business rule. If you also have the bundled exception mode enables (which will be the case by default for web applications), then multiple messages can be shown at the same time.
    If you have one business rule involving two different attributes, for example a and b, and you must provide different messages based on if a is causing the violation or b, you can do it like this:
    - implement one method doing the validation and that will indicate which attribute is causing the violation
    - implement two different method validators (with two different messages) that call the method doing the actual validation and return false based on the attribute causing the violation
    For more information about implementing business rules in ADF BC, you might have a look at this white paper:
    http://www.oracle.com/technology/products/jdev/collateral/papers/10131/businessrulesinadfbctechnicalwp.pdf
    Jan Kettenis

  • How to Visible/Hide an Item based on the value of another Item

    Hi
    I need to visible and hide a textitem based on the value of another item.This form has 3 blocks, and the both item is in the first Master Block.
    My code is:
    if :RECORDTYPE=7 then
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_TRUE);
         Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_TRUE);
    ELSE
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_FALSE);
    Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_FALSE);
    :BLOCK.ITEM:=NULL;
    end if;     
    I wrote the code in the Validate Trigger, but not working when moving Next Record & Previous Record
    Thanks in advance
    Rizly

    Read the 'Propagation of Property Changes' section towards the end of the page for Set_Item_Property in the online help. I'm not sure what you mean by locking automatically but perhaps it's because of this.
    You should also ensure the item you're setting to invisible is not the current item (check :system.cursor_item and go to a different item if necessary).

  • Count of schema based on the value in a column

    I have to write a query to count the number of schema that have the value in a column as '1' in a table For ex
    I have a table called Vendor in all the schemas(schema1 through 50) I have to look for the value in a column(Benefits) if it 1 or 0 . I need to do the count of the number of schema who have the Benefits turned ON (value '1')
    suppose the value in benefits(col) in Vendor (tbl) for schema1 is 0 than donot count that schema
    and if the value in benefits(col) in Vendor (tbl) for schema2 is 1 than count
    do i connect as a system manager? Do I need a Pl/sql table to put the count in it
    anybody please help.
    TX
    KK

    As I understand from 325537 description, the table VENDOR contains only one row and column BENEFITS_TRACKING is either 0 or 1
    In this case the total can be calculated by simply summing the values of all BENEFITS_TRACKING
    In case VENDOR has more than one row you need some grouping function like SUM or COUNT
    I don't unterstand why you loop through dba_users.
    Im quite sure that you won't find a VENDORS table in the SYSTEM schema. The 'execute immediate' will fail with a table not found exception.
    Another problem in your code is, you will get no_data_found exception when benefits_tracking=0 because of your where condition
    (remove the where-condition or use a grouping function as explained above)
    declare
      v_count      pls_integer := 0;
      v_curr_count pls_integer := 0;
    begin
      for rec in (select owner from all_tables where owner like 'SCHEMA%' and table_name='VENDORS') loop
          execute immediate 'select SUM(BENEFITS_TRACKING) from '||rec.owner||'.VENDORS' into v_curr_count;
    --      execute immediate 'select COUNT(BENEFITS_TRACKING) from '||rec.owner||'.VENDORS where BENEFITS_TRACKING=1' into v_curr_count;
    --      execute immediate 'select BENEFITS_TRACKING from '||rec.owner||'.VENDORS' into v_curr_count;
          v_count := v_count + v_curr_count;
      end loop;
      dbms_output.put_line(v_count);
    end;

  • Populate one text field on a form based on the value in another

    I am new to APEX and building my first application.
    When a user enters a value in one field, I would like to run a SQL command and then display a value in another field based on the value in the first field. For instance, if a user enters a part number in one field, when they tab off of the field, I would like to display the name of the part in the part name field.
    Thanks

    Thanks. That put me on the right track. I used that link to find the link http://htmldb.oracle.com/pls/otn/f?p=11933:11:2890374750690437 and then using the two was able to put together a solution.
    I am down to one last issue. I am able to return the name back from the process and display it with an alert statement. Unfortunately, I am unable to display the value on the form.
    I am doing the following.
    <script language="JavaScript1.1" type="text/javascript">
    function f_getCustomerName(id)
    var v_id = id;
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=getCustomerName',$v('pFlowStepId'));
    get.addParam('x01',$v('P2_CUSTOMER_ID'));
    gReturn = get.get();
    get = null;
    gReturn = (!gReturn)?'null':gReturn;
    /* The below do not work
    $s('P2_CUSTOMER_NAME',gReturn);
    document.getElementById('P2_CUSTOMER_NAME').value = gReturn;
    document.getElementById('P2_CUSTOMER_NAME').value = 'TEST';
    alert(document.getElementById('P2_CUSTOMER_NAME').value );
    alert(gReturn);
    //-->
    </script>
    Process: getCustomerName
    declare
    l_customer_id customer.customer_id%type;
    l_customer_name customer.customer_name%type;
    begin
    l_customer_id := to_number(wwv_flow.g_x01);
    select customer_name
    into l_customer_name
    from customer
    where customer_id = l_customer_id;
    htp.p(l_customer_name);
    end;

  • Formula to populate one Person or Group column depending on the value of another Person Group column

    I am looking for a way to popluate the Account information of a Person based on another column where there name in another column.  I have Two Columns   "Name" which is a Person or Group information type and User Account which
    is also a Person or Group Information type.  When an Invidividuals name is entered into the Name column, I what the User Account column to prepolulate.

    Hi,
    For your issue, you can automatically populate User Information depending on the value of another Person or Group column by connectting with User Information List or  connectting with User Profile Web Service:
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=172
    http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Sorting an array based on the value of another array

    Hi
    Ive got 2 arrys... An Integer[]{11,12,23,24,25};
    and another one double[]{60,79,83,54,67};
    i wanna sort the first array based on the values of the second array..
    ie my result should be double[]{83,79,67,60,54} and
    Integer[]={23,12,25,11,24}...........
    is thr any easy method to do tis..

    You should make a class with the int and the double as fields; and have your class implement Comparable to compare on the double the way you want; and just have an array of objects of this class, and sort it.
    Because the corresponding elements in your arrays are essentially linked, so they should be together.
    Edited by: spoon_ on Apr 12, 2008 2:17 AM

  • How to merge values in a row, based on distinct values in another column

    I have a table like
    updatedby updateddate text
    John 01-May-2009 Approval record 1 added
    John 01-May-2009 Approval record 2 added
    David 02-May-2009 Approval record 1 removed
    I need the values of text column to be concatenated and displayed for unique records of (updatedby updateddate). The output is something like
    updatedby updateddate text
    John 01-May-2009 Approval record 1 added, Approval record 2 added
    David 02-May-2009 Approval record 1 removed
    I had planned to do it using PLSQL. Is there a way to get this done by SQl?.. Kindly suggest

    Prior to 10g:
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn,
                     count(*) over(partition by updatedby,updateddate) cnt
               from  t
      where rn = cnt
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updateddate,
               updatedby
    UPDAT UPDATEDDA TEXT
    John  01-MAY-09 Approval record 1 added,Approval record 2 added
    David 02-MAY-09 Approval record 1 removed
    SQL> 10g and up:
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn
               from  t
      where connect_by_isleaf = 1
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updatedby,
               updateddate
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn
               from  t
      where connect_by_isleaf = 1
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updateddate,
               updatedby
    UPDAT UPDATEDDA TEXT
    John  01-MAY-09 Approval record 1 added,Approval record 2 added
    David 02-MAY-09 Approval record 1 removed
    SQL> SY.

  • How to get the total number of occurrences based on the value of a column.

    Hello everyone,
    This is the first time that I will ask question here on your forum but has been following several threads ever since. I guess that now is my turn to ask a question. So anyway here is the thing, I have a query that should return count the number of rows depending on the value of SLOT. Something like this:
    WIPDATAVALUE          SLOT             N            M
    1-2                   TRALTEST43S1     1            3
    1-2                   TRALTEST43S1     2            3
    3                     TRALTEST43S1     3            3
    4-6                   TRALTEST43S2     1            4
    4-6                   TRALTEST43S2     2            4
    4-6                   TRALTEST43S2     3            4
    7                     TRALTEST43S2     4            4-----
    As you can see above, on the SLOT TRALTEST43S1, there are three occurrences so M (Total number of occurrences) should be three and that column N should count it. Same goes with the SLOT TRALTEST43S2. This is the query that I have so far:
    SELECT DISTINCT
    WIPDATAVALUE, SLOT
    , LEVEL AS n
    , m
    FROM
      SELECT
        WIPDATAVALUE
        , SLOT
        , (dulo - una) + 1 AS m
      FROM
        SELECT
          WIPDATAVALUE
          , SLOT
          , CASE WHEN INSTR(wipdatavalue, '-') = 0 THEN wipdatavalue ELSE SUBSTR(wipdatavalue, 1, INSTR(wipdatavalue, '-')-1) END AS una
          , CASE WHEN INSTR(wipdatavalue, '-') = 0 THEN wipdatavalue ELSE SUBSTR(wipdatavalue, INSTR(wipdatavalue, '-') + 1) END AS dulo
        FROM trprinting
        WHERE (containername = :lotID OR SLOT= :lotID) AND WIPDATAVALUE LIKE :wip
    ) CONNECT BY LEVEL <= m
    ORDER BY wipdatavalue;And that it results to something like this:
    WIPDATAVALUE          SLOT             N            M
    1-2                   TRALTEST43S1     1            2
    1-2                   TRALTEST43S1     2            2
    3                     TRALTEST43S1     1            1
    4-6                   TRALTEST43S2     1            3
    4-6                   TRALTEST43S2     2            3
    4-6                   TRALTEST43S2     3            3
    7                     TRALTEST43S2     1            1-----
    I think that my current query is basing its M and N results on WIPDATAVALUE and not the SLOT that is why I get the wrong output. I have also tried to use the WITH Statement and it works well but unfortunately, our system cant accept subquery factoring.
    I know you guys will be helping out because you are all awesome. Thanks everyone
    Edited by: 1001275 on Apr 19, 2013 8:07 PM
    Edited by: 1001275 on Apr 19, 2013 8:18 PM

    Hi,
    Sorry, it's still not clear what you want.
    Are you saying that, given this table:
    CREATE TABLE trprinting
      WIPDATAVALUE       VARCHAR2(255)
    , SLOT               VARCHAR2(255)
    INSERT INTO trprinting (wipdatavalue, slot) VALUES ('1-2',  'TRALTEST43S1');
    INSERT INTO trprinting (wipdatavalue, slot) VALUES ('3',    'TRALTEST43S1');
    INSERT INTO trprinting (wipdatavalue, slot) VALUES ('4-6',  'TRALTEST43S2');
    INSERT INTO trprinting (wipdatavalue, slot) VALUES ('7',    'TRALTEST43S2');you want to produce this output:
    WIPDATAVALUE SLOT                     N          M
    1-2          TRALTEST43S1             1          3
    1-2          TRALTEST43S1             2          3
    3            TRALTEST43S1             3          3
    4-6          TRALTEST43S2             1          4
    4-6          TRALTEST43S2             2          4
    4-6          TRALTEST43S2             3          4
    7            TRALTEST43S2             4          4? If so, here's one way:
    WITH     got_numbers     AS
         SELECT     wipdatavalue
         ,     slot
         ,     TO_NUMBER ( SUBSTR ( wipdatavalue
                               , 1
                           , INSTR ( wipdatavalue || '-'
                                ) - 1
                     )          AS low_number
         ,     TO_NUMBER ( SUBSTR ( wipdatavalue
                               , 1 + INSTR ( wipdatavalue
                     )          AS high_number
         FROM     trprinting
    SELECT       wipdatavalue
    ,       slot
    ,       ROW_NUMBER () OVER ( PARTITION BY  slot
                                 ORDER BY          low_number
                        )                    AS n
    ,       COUNT (*)     OVER ( PARTITION BY  slot )     AS m
    FROM       got_numbers
    CONNECT BY     LEVEL               <= high_number + 1 - low_number
         AND     low_number          = PRIOR low_number
         AND     PRIOR SYS_GUID ()      IS NOT NULL
    ORDER BY  low_number
    ,            n
    ;Much of the complexity here is caused by storing 2 numbers in 1 VARCHAR2 column, wipdatavalue. Relational databases work best when there is no more than 1 item in any given column of any given row. This is so basic to datbase design that it is called First Normal Form. Also, numbers belong in NUMBER columns, not VARCHAR2. If you stored your data like that in the fist place, then you wouldn't need the sub-query I called got_numbers, which is about 60% of the code above. (That could be reduced by replacing SUSTR and INSTR with the less efficient REGEGP_SUBSTR.)

Maybe you are looking for

  • Adobe Photoshop Elements 4.0 and Snow Leopard

    Can someone please help. We recently updated from 10.4 to 10.6 and now everytime I open Photoshop (4.0) it runs for maybe 30 seconds then stops and gives a message that Photoshop unexpectedly quit. I really need this program for my school work

  • HELP! How do I enforce a required field

    All I do hope someone can help me with this!!! I have a pdf where I require the person before submitting to check a check box to confirm they understand a key statement. the checkbox is called Confirm. I have seen some javascript here http://forums.a

  • Looking for an online LR3 gallery that allows clients to give feedback.

    Tried FSS Select from LightroomGalleries but no luck (I only get an endless "loading gallery"). I just want something simple that would allow clients to provide feedback (comments/picks/ratings) on a series of photos I just took for them. Any suggest

  • ITunes will not allow photos to sync

    iPod Touch 1 gen, 09 Mac Mini, Snow Leopard, iTunes claims that there is not enough space on my iPod for Photos, it removed the photos that were already present. I want to put about 10 MB of photos, there is 230 MB of space. What to do???

  • Picture UNDER Navigation link Problem? now links don't work

    Sorry for the repost need to add a few things Hi- I am having a problem with using a background image "under" the navigation links?? Here is what I did (Thanks to James S. who taught me this trick I: optimized a full page jpg and dragged it to my web