Best way to express Boolean values in a table?

Hello

I'm looking for the best way to express Boolean values in a table. Is there a better way than this one?

Men Women Children
YesYesNO.
NO.YesNO.

Or I guess I could draw that checked sign for Yes and X sign for no.? Or is there anywhere I can download those?

Thank you!

That would you say a solid bullet for YES, hollow for no-much easier to see the difference at a glance.

Tags: InDesign

Similar Questions

  • Best way to store the values of the map

    Hi all.

    I have a card <>where I store the values (in this case, I store the IDs of rows in the table). I have an application with a panel tabs and I have a card for each tab. When the user exits the application, I'll go through the card and the identity of any process

    If I use normal in my grain map, once the user changes tab (or opens a pop up or something like that), the map is instantiated again and all data is lost. To resolve this problem, I used a static map. Everything is ok, but if 2 users use the application at the same time, they will share the card data and I don't want that.

    So I have a question: what is the best way to keep my card? I read some people saying to use one Bean of sessionScope, others a pageFlowBean, other parameters of Page, etc...

    Can you help me?

    P.s: jdev version 11.1.2.4.0

    Well, you can create a managed bean in this scope, or you can put your card directly at your fingertips.

    Here you will find several techniques to get the bean managed in java code: http://www.lkakarla.com/2013/06/retrieving-managed-beans.html

    Dario

  • Best way to select distinct values, based on another column?

    I have a table with three columns: id (NUMBER), data_dt (DATE) and data_value (NUMBER).
    There is a primary key id and data_dt.

    I want to choose the folder with the last data_dt for each unique identification number.

    What is the best way to do it?
    I have three different methods, but there may be something that I am missing.

    First of all:
    SELECT *
    FROM
    (
      SELECT id, data_dt, data_value,
             FIRST_VALUE(data_dt)
             OVER (PARTITION BY id ORDER BY data_dt DESC) AS last_data_dt
      FROM the_table
    )
    WHERE data_dt = last_data_dt;
    (I use ORDER BY... DESC, instead of just ORDER BY I don't need the clause BETWEEN the LINES)


    Second:
    SELECT t1.*
    FROM the_table t1
    JOIN
    (
      SELECT id, MAX(data_dt) AS last_data_dt
      FROM the_table
      GROUP BY id
    ) t2 ON (t2.id = t1.id AND t2.data_dt = t1.data_dt);
    Third:
    SELECT t1.*
    FROM the_table t1
    WHERE t1.data_dt =
    (
      SELECT MAX(t2.data_dt)
      FROM the_table t2
      WHERE t2.id = t1.id
    );
    -Don

    As mentioned in hoek, you will need to test all scenarios.

    However, in my opinion the more faster will be those who accesses the table that only ONCE instead of TWICE as some scenarios require.

    HTH!

  • can I store the output of boolean values in a table?

    the codification output here is '1' and '0'...
    I want to store only '1' and '0' in a table...

    but I can't do it please help me...

    How to store?...

    DECLARE
    EID VARCHAR2 (20);
    BOOLEAN BL: = TRUE;
    BEGIN
    SELECT EMP_NO
    IN EID
    OF LEAVE_FORM
    WHERE EMP_NO = 1;
    BL: = TRUE;
    DBMS_OUTPUT. Put_line (sys. DIUTIL.bool_to_int (BL));
    insert into t1 (BL) values; - error
    EXCEPTION
    When no_data_found then
    BL: = FALSE;
    DBMS_OUTPUT. Put_line (sys. DIUTIL.bool_to_int (BL));
    END;

    Published by: 794244 on February 9, 2011 03:11

    No, you can't. BOOLEAN is no SQL, PL/SQL data type. You did not post structure of table t1. Assumimg t1 column has the number value, use:

    DECLARE
        BL BOOLEAN := TRUE;
        N  NUMBER;
    BEGIN
        N:= sys.DIUTIL.bool_to_int(BL);
        DBMS_OUTPUT.PUT_LINE(N);
        insert into t1 values(N);
        BL := FALSE;
        N:= sys.DIUTIL.bool_to_int(BL);
        DBMS_OUTPUT.PUT_LINE(N);
        insert into t1 values(N);
    END;
    /
    select * from t1
    /
    
            BL
    ----------
             1
             0
    
    SQL>  
    

    SY.

  • ADF12C: The best way to add the filter of the table of af: selectBooleanCheckbox

    I have an af:table in my page and the default filter is enabled for all columns.

    I have a column of type checkbox. I would like to add the checkbox to filter to filter the checked and uncheck the data. My checkbox data are mapped to 0 and 1

    1.JPG

    My code:

    < af:column headerText = "#{bindings." ABC.hints.Col1.label}"id ="c7 ".

    sortProperty = "#{bindings." ABC.hints.Col1.name}.

    filterable = "true" sortable = "true" >

    "< af:selectBooleanCheckbox value =" #{row.bindings.Col1.inputValue} "label =" #{row.bindings.Col1.label} "disabled ="true"shortDesc =" #{bindings. " ABC.hints.Col1.tooltip}"id ="sbc1"/ >

    < f: facet = name 'filter' >

    < af:panelGroupLayout id = "pgl2" halign = "center" >

    < af:selectBooleanCheckbox value = "#{vs.filterCriteria.Col1}" autoSubmit = "true" id = "sbc2" / > "

    < / af:panelGroupLayout >

    < / f: facet >

    < / af:column >

    I have to use < f: facet = 'filter' name > option to implement, but get the error below.

    "ORA-01722: invalid number."

    Any help is appreciated.

    Thank you

    Luke.

    You are welcome.

    Can you close it please message by checking one of the answers as Correct?

  • Best way to reach the 2 columns of table A of the same column in the Table B?

    Hello

    It is a simplified example of the query, I am writing.

    I have two tables - PIPELINE (which includes the CREDIT_RECEIVER and CREATOR columns) and EMPLOYEES (including E-MAIL and LOB columns).

    I want to write a query that joins the PIPELINE. CREDIT_RECEIVER with EMPLOYEES. E-MAIL to return the LOB as 'CREDIT_RECEIVER_LOB '.

    I also want this query to join PIPELINE. CREATOR of EMPLOYEES. E-MAIL to return the LOB as 'CREATOR_LOB '.

    Currently, I do a left outer join on EMPLOYEES. EMAIL = PIPELINE. CREDIT_RECEIVER to get the "CREDIT_RECEIVER_LOB" and by calling a function GET_LOB (PIPELINE. CREATOR) (as defined below) to get the "CREATOR_LOB".

    Query:

    Select PIPELINE.ID as ID,

    PIPELINE. CREDIT_RECEIVER as CREDIT_RECEIVER,

    PIPELINE. CREATOR as a CREATOR,

    EMPLOYEES. LOB as CREDIT_RECEIVER_LOB,

    GET_LOB (PIPELINE. CREATOR) as CREATOR_LOB

    PIPELINE

    JOIN EXTERNAL LEFT ON PIPELINE EMPLOYEES. CREDIT_RECEIVER = EMPLOYEES. E-mail

    Is there a better way to write this query? This request is so slow it will usually expire on me.



    Thank you


    Forrest

    Definition of GET_LOB

    create or replace function "GET_LOB"

    ()vemail in VARCHAR2()

    return VARCHAR2

    is

    Start

    DECLARE vlog VARCHAR2 (30) ;

    BEGIN

    SELECT LOB IN vlog DE EMPLOYEES E-mail = Vemail ;

    return vlog ;

    END ;

    end ;

    Select PIPELINE.ID as ID,

    PIPELINE. CREDIT_RECEIVER as CREDIT_RECEIVER,

    PIPELINE. CREATOR as a CREATOR,

    E1. LOB as CREDIT_RECEIVER_LOB,

    E2. LOB as CREATOR_LOB

    PIPELINE

    LEFT OUTER JOIN EMPLOYEES E1

    WE PIPELINE. CREDIT_RECEIVER = EMPLOYEES. E-mail

    LEFT OUTER JOIN EMPLOYEES E2

    WE PIPELINE. CREATOR = EMPLOYEES. E-mail

    ----

    Ramin Hashimzade

  • best way to avoid the full table scan for clause "column is zero.

    I have a query with is control null, and because of that it performs a total scan of table (in millions of rows in the table)

    SELECT id, x,
    LAG (id) OVER (PARTITION BY userid ORDER BY has had place, id) as p_id,.
    FROM MyTable
    WHERE X is ZERO


    What is the best way for me to avoid the full table scan. I have indexes for the X column and other columns.

    Thank you

    Hi Vasif

    NULL values are indexed if the indexed entry also includes a value non-zero.

    If you create an index such as:

    CREATE INDEX mytable_x_idx ON mytable (x, ' ');

    ensure all null values for the column X are indexed and will therefore potentially use the index to search for null values, assuming of course the result set is small enough to justify the use of the index in your query.

    I have spoken previously on my blog:

    http://richardfoote.WordPress.com/2008/01/23/indexing-nulls-empty-spaces/

    See you soon

    Richard Foote
    http://richardfoote.WordPress.com/

  • Best way to remove millions of records


    Hi gurus

    Just for my goal of learning, which should be the best way to remove records from the entire table containing millions of records, I know about truncate command, but is there any other way around?

    Concerning

    Muzz

    Hello

    If you want to remove all the lines, then nothing can TRUNCATE TABLE for performance.  You cannot RESTORE a DML, as TRUNCATE TABLE operation, that's why it's so fast: he doesn't have to remember what has been deleted.  TRUNCATE TABLE will leave privileges, constraints, triggers, and intact the table storage parameters.

  • What is the best way to get a Table name in Oracle Applications: 12.1.1 (web)

    Hello friends...


    I need your help my friends...


    We are currently working on Oracle Applications: 12.1.1

    I would like to know the best way to get the name of the Table to form based on a Web...


    Concerning

    Yas.

    Hello

    Please see this thread and documents referenced in it.

    RECORD HISTORY (or) COLUMNS in R12?
    RECORD HISTORY (or) COLUMNS in R12?

    Kind regards
    Hussein

  • [8i] best way to replace the 'similar' value values...?

    Some examples of data:

    Sorry for the large / complex set of sample data, but there should be no need to go through it in detail =).

    2 things to keep in mind:
    (1) it is a 8i db
    (2) I can't create any tables in the db, if I can create views
    CREATE TABLE     ord_master
    (     part_nbr          CHAR(25)
    ,     ord_nbr          CHAR(10)
    ,     sub_ord_nbr     CHAR(3)
    ,     ord_type          CHAR(2)
    ,     ord_stat          CHAR(2)
    ,     date_closed     DATE
    );
    
    -- please note, though none of the columns in ord_master are explicitly defined as NOT NULL, 
    -- none of them are NULL in the db, and given how things are input into the table, I don't 
    -- even think it's possible
    
    -- a unique order is described by ord_nbr, sub_ord_nbr.  there should only be one record in
    -- this table for a given unique combination of those columns, though they are not the p.k.
    
    -- NOTE: dates default to 12/31/1900, so in the table above, if an order is still open (thus, 
    -- not closed), it's date_closed will be 12/31/1900.  It will only change once the order closes.
    
    INSERT INTO     ord_master
    VALUES     ('ABC-123','1','1','AA','CL',TO_DATE('05/01/2009','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('ABC-123','1','2','AA','CL',TO_DATE('9/14/2009','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('ABC-123','2','1','AA','CL',TO_DATE('12/03/2009','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('ABC-123','3','1','AA','OP',TO_DATE('12/31/1900','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('ABC-123','4','1','AA','CL',TO_DATE('03/12/2004','mm/dd/yyyy'));
    INSERT INTO     ord_master
    VALUES     ('XYZ-123','5','1','AA','CL',TO_DATE('03/12/2004','mm/dd/yyyy'));
    
    
    CREATE TABLE     op_detail
    (     ord_nbr          CHAR(10)
    ,     sub_ord_nbr     CHAR(3)
    ,     major_seq_nbr     CHAR(4)
    ,     wctr_id          CHAR(5)
    ,     oper_stat          CHAR(2)
    ,     plan_su_rsrc     NUMBER(5,2)
    ,     plan_run_rsrc     NUMBER(11,8)
    ,     plan_subc_amt     NUMBER(15,5)
    ,     act_su_rsrc     NUMBER(5,2)
    ,     act_run_rsrc     NUMBER(7,2)
    ,     act_subc_amt     NUMBER(15,2)
    ,     act_start_dt     DATE
    ,     dt_completed     DATE
    ,     qty_planned     NUMBER(13,4)
    ,     qty_recvd          NUMBER(13,4)
    ,     qty_complete     NUMBER(13,4)
    ,     qty_scrap          NUMBER(13,4)
    ,     qty_on_hold     NUMBER(13,4)
    );
              
    -- similar to ord_master, thought none of the columns are explicitly defined as NOT NULL, 
    -- none of the records have NULL values for any of these columns, and I don't think it's 
    -- really possible with the way the system is
    
    INSERT INTO     op_detail
    VALUES     ('1', '1', '0081', 'X516 ', 'CP', 0, 0, 0, 0, .2, 0, TO_DATE('02/03/2010', 'mm/dd/yyyy'), TO_DATE('02/03/2010', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '1', '0324', 'Y000 ', 'CP', .1, .2, 0, 0, .87, 0, TO_DATE('04/06/2010', 'mm/dd/yyyy'), TO_DATE('04/06/2010', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '1', '0170', 'X928 ', 'CP', 0, 0, 9.6, 0, 0, 159, TO_DATE('03/05/2010', 'mm/dd/yyyy'), TO_DATE('03/05/2010', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '1', '0130', 'H211 ', 'CP', .5, .1, 0, .08, .63, 0, TO_DATE('02/10/2010', 'mm/dd/yyyy'), TO_DATE('02/10/2010', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0120', 'H214 ', 'CP', .3, .05, 0, 0, .68, 0, TO_DATE('05/22/2009', 'mm/dd/yyyy'), TO_DATE('05/22/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0122', 'T203 ', 'CP', 2.5, 1, 0, .67, .3, 0, TO_DATE('05/28/2009', 'mm/dd/yyyy'), TO_DATE('05/28/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0130', 'H211 ', 'CL', .5, .1, 0, .67, .3, 0, TO_DATE('05/28/2009', 'mm/dd/yyyy'), TO_DATE('05/28/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0170', 'X928 ', 'CP', 0, 0, 9.6, 0, 0, 153.12, TO_DATE('06/10/2009', 'mm/dd/yyyy'), TO_DATE('06/10/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('1', '2', '0324', 'Y000 ', 'CP', .1, .2, 0, 0, .08, 0, TO_DATE('06/17/2009', 'mm/dd/yyyy'), TO_DATE('06/17/2009', 'mm/dd/yyyy'), 3, 3, 3, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('2', '1', '0081', 'X516 ', 'CL', 0, 0, 0, 0, 0, 0, TO_DATE('07/20/2009', 'mm/dd/yyyy'), TO_DATE('07/20/2009', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('2', '1', '0324', 'Y000 ', 'CL', .1, .2, 0, 0, 3.03, 0, TO_DATE('09/11/2009', 'mm/dd/yyyy'), TO_DATE('09/11/2009', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('2', '1', '0170', 'X928 ', 'CP', 0, 0, 9.6, 0, 0, 204.16, TO_DATE('08/11/2009', 'mm/dd/yyyy'), TO_DATE('08/11/2009', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('2', '1', '0130', 'H211 ','CP', .5, .1, 0, 1.97, 2.67, 0, TO_DATE('07/28/2009', 'mm/dd/yyyy'), TO_DATE('07/29/2009', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('3', '1', '0170', 'X928 ', 'CP', 0, 0, 9.6, 0, 0, 255.2, TO_DATE('11/06/2009', 'mm/dd/yyyy'), TO_DATE('11/06/2009', 'mm/dd/yyyy'), 5, 5, 5, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('3', '1', '0130', 'H212 ', 'CP', .5, .1, 0, .6, .03, 0, TO_DATE('10/21/2009', 'mm/dd/yyyy'), TO_DATE('10/21/2009', 'mm/dd/yyyy'), 5, 5, 5, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('3', '1', '0550', 'R501 ', 'WK', 1, 16, 0, 2.2, 12.4, 0, TO_DATE('05/19/2010', 'mm/dd/yyyy'), TO_DATE('12/31/1900', 'mm/dd/yyyy'), 5, 5, 5, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('3', '1', '0324', 'Y000 ', 'CL', .1, .2, 0, 0, .07, 0, TO_DATE('02/04/2010', 'mm/dd/yyyy'), TO_DATE('02/04/2010', 'mm/dd/yyyy'), 5, 5, 5, 0, 0);
    INSERT INTO     op_detail
    VALUES     ('4', '1', '0324', 'Y000 ', 'CP', .1, .2, 0, 0, .59, 0, TO_DATE('02/06/2004', 'mm/dd/yyyy'), TO_DATE('02/06/2004', 'mm/dd/yyyy'), 4, 4, 4, 0, 0);
    This is the query, I'm working with right now:
    SELECT     o.part_nbr               
    ,          s.major_seq_nbr          AS op_nbr
    ,          CASE          -- CASE statement to replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                   WHEN     s.wctr_id     IN ('H211','H212')
                   THEN     'Z211'
                   ELSE     s.wctr_id
              END                         AS wctr
    ,          MIN(s.plan_su_rsrc)          AS min_plan_setup
    ,          AVG(s.plan_su_rsrc)          AS avg_plan_setup
    ,          MAX(s.plan_su_rsrc)          AS max_plan_setup
    ,          STDDEV(s.plan_su_rsrc)     AS sdev_plan_setup
    ,          MIN(s.plan_run_rsrc)     AS min_plan_run
    ,          AVG(s.plan_run_rsrc)     AS avg_plan_run
    ,          MAX(s.plan_run_rsrc)     AS max_plan_run
    ,          STDDEV(s.plan_run_rsrc)     AS sdev_plan_run
    ,          MIN(s.plan_subc_amt)     AS min_plan_subc
    ,          AVG(s.plan_subc_amt)     AS avg_plan_subc
    ,          MAX(s.plan_subc_amt)     AS max_plan_subc
    ,          STDDEV(s.plan_subc_amt)     AS sdev_plan_subc
    ,          MIN(s.act_su_rsrc)          AS min_act_setup
    ,          AVG(s.act_su_rsrc)          AS avg_act_setup
    ,          MAX(s.act_su_rsrc)          AS max_act_setup
    ,          STDDEV(s.act_su_rsrc)     AS sdev_act_setup
    ,          MIN(s.act_run_rsrc)          AS min_act_run
    ,          AVG(s.act_run_rsrc)          AS avg_act_run
    ,          MAX(s.act_run_rsrc)          AS max_act_run
    ,          STDDEV(s.act_run_rsrc)     AS sdev_act_run
    ,          MIN(s.act_subc_amt)          AS min_act_subc
    ,          AVG(s.act_subc_amt)          AS avg_act_subc
    ,          MAX(s.act_subc_amt)          AS max_act_subc
    ,          STDDEV(s.act_subc_amt)     AS sdev_act_subc     
    ,          MIN(s.act_start_dt)          AS min_start
    ,          MAX(s.act_start_dt)          AS max_start
    ,          MIN(s.dt_completed)          AS min_comp
    ,          MAX(s.dt_completed)          AS max_comp
    ,          MIN(s.qty_planned)          AS min_qty_plan
    ,          AVG(s.qty_planned)          AS avg_qty_plan
    ,          MAX(s.qty_planned)          AS max_qty_plan
    ,          STDDEV(s.qty_planned)     AS sdev_qty_plan
    ,          MIN(s.qty_recvd)          AS min_qty_recvd
    ,          AVG(s.qty_recvd)          AS avg_qty_recvd
    ,          MAX(s.qty_recvd)          AS max_qty_recvd
    ,          STDDEV(s.qty_recvd)          AS sdev_qty_recvd
    ,          MIN(s.qty_complete)          AS min_qty_comp
    ,          AVG(s.qty_complete)          AS avg_qty_comp
    ,          MAX(s.qty_complete)          AS max_qty_comp
    ,          STDDEV(s.qty_complete)     AS sdev_qty_comp
    ,          MIN(s.qty_scrap)          AS min_qty_scrap
    ,          AVG(s.qty_scrap)          AS avg_qty_scrap
    ,          MAX(s.qty_scrap)          AS max_qty_scrap
    ,          STDDEV(s.qty_scrap)          AS sdev_qty_scrap
    ,          MIN(s.qty_on_hold)          AS min_qty_hold
    ,          AVG(s.qty_on_hold)          AS avg_qty_hold
    ,          MAX(s.qty_on_hold)          AS max_qty_hold
    ,          STDDEV(s.qty_on_hold)     AS sdev_qty_hold
    ,          COUNT(*)                    AS rec_cnt
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END                         AS time_period
    FROM          ord_master o
    ,          op_detail     s
    ,          (     -- begin in-line view a, to get the min act_start_dt for each order
              SELECT     s1.ord_nbr
              ,          s1.sub_ord_nbr
              ,          MIN     (
                             CASE
                                  WHEN     s1.act_start_dt     > TO_DATE('01/01/2000','mm/dd/yyyy')
                                  THEN     s1.act_start_dt
                             END
                             )          AS ord_min_start
              FROM          op_detail s1
              GROUP BY     s1.ord_nbr
              ,          s1.sub_ord_nbr
              ) a     -- end in-line view a          
    WHERE     o.ord_nbr          = s.ord_nbr
    AND          o.sub_ord_nbr     = s.sub_ord_nbr
    AND          o.ord_nbr          = a.ord_nbr
    AND          o.sub_ord_nbr     = a.sub_ord_nbr
    AND          o.ord_type     = 'AA'
    AND          o.ord_stat     IN ('CL','OP')
    AND          s.oper_stat     IN ('CL','CP')
    GROUP BY     o.part_nbr
    ,          s.major_seq_nbr
    ,          CASE          -- CASE statement to replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                   WHEN     s.wctr_id     IN ('H211','H212')
                   THEN     'Z211'
                   ELSE     s.wctr_id
              END
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END
    ORDER BY     o.part_nbr
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END
    ,          s.major_seq_nbr
    It gives me a lot of descriptive statistics on data stored in the database, divided into groups of the time period.

    I have 7 sets of possible values for the wctr_id column, which are groups of similar/identical positions and should be treated as the same, assuming that the ord_nbr, sub_ord_nbr and major_seq_nbr are the same. In my case statement example above, every time I find 'H211' or 'H212', I'm replacing it with "Z211', which is my new unique identifier for all wctr in the Group ("H211', "H212"). I have 7 of these kinds of groups that should be replaced by a new unique identifier. Is my statement CASE (above) the best way to do it, or is there a better way? These groups of similar-wctr_id are not listed in a table anywhere.

    Hello

    As always, thanks for posting the CREATE TABLE and INSERT statements. It is very useful and leads to the more quickly, better solutions.
    Another thing that is useful and promotes better solutions, faster, is to simplify your problem.
    For example, you need to calculate a large number of aggregates, but looks like you already know how to do this. This issue only affects the CASE expressions, and how they interact with the GROUP BY clause. So just cut most of the aggregate functions.
    Also, it seems that the finer points of view one online have nothing to do with your current problem. For purposes of recognition of this problem, pretend that one is a regular display, so it does not clutter the main request.

    I think your problem might be reformulated as follows:
    You already have a query like this:

    CREATE OR REPLACE VIEW a
    AS
              SELECT     s1.ord_nbr
              ,          s1.sub_ord_nbr
              ,          MIN     (
                             CASE
                                  WHEN     s1.act_start_dt     > TO_DATE('01/01/2000','mm/dd/yyyy')
                                  THEN     s1.act_start_dt
                             END
                             )          AS ord_min_start
              FROM          op_detail s1
              GROUP BY     s1.ord_nbr
              ,          s1.sub_ord_nbr
    ;
    
    SELECT     o.part_nbr
    ,          s.major_seq_nbr          AS op_nbr
    ,          CASE          -- CASE statement to replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                   WHEN     s.wctr_id     IN ('H211','H212')
                   THEN     'Z211'
                   ELSE     s.wctr_id
              END                         AS wctr
    ,          MIN(s.plan_su_rsrc)          AS min_plan_setup
              -- lots of other agtgregates go here in real query
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END                         AS time_period
    FROM          ord_master o
    ,          op_detail     s
    ,          a          -- in real query, a is an in-line view
    WHERE     o.ord_nbr          = s.ord_nbr
    AND          o.sub_ord_nbr     = s.sub_ord_nbr
    AND          o.ord_nbr          = a.ord_nbr
    AND          o.sub_ord_nbr     = a.sub_ord_nbr
    AND          o.ord_type     = 'AA'
    AND          o.ord_stat     IN ('CL','OP')
    AND          s.oper_stat     IN ('CL','CP')
    GROUP BY     o.part_nbr
    ,          s.major_seq_nbr
    ,          CASE          -- CASE statement to replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                   WHEN     s.wctr_id     IN ('H211','H212')
                   THEN     'Z211'
                   ELSE     s.wctr_id
              END
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END
    ORDER BY     o.part_nbr
    ,          CASE
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                   THEN     '12 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                   THEN     '24 mos. back'
                   WHEN a.ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                   THEN     '36 mos. back'
                   ELSE '37 mos. back +'
              END
    ,          s.major_seq_nbr
    ;
    

    which produces this output:

    `                       MIN_
                           PLAN_
    PART_NBR   OP_N WCTR   SETUP TIME_PERIOD
    ---------- ---- ----- ------ --------------
    ABC-123    0081 X516      .0 12 mos. back
    ABC-123    0130 Z211      .5 12 mos. back
    ABC-123    0170 X928      .0 12 mos. back
    ABC-123    0324 Y000      .1 12 mos. back
    ABC-123    0120 H214      .3 24 mos. back
    ABC-123    0122 T203     2.5 24 mos. back
    ABC-123    0130 Z211      .5 24 mos. back
    ABC-123    0170 X928      .0 24 mos. back
    ABC-123    0324 Y000      .1 24 mos. back
    ABC-123    0324 Y000      .1 37 mos. back +
    

    The output is correct; the problem is, can we get the same results without 2 copies of the expression BOX wctr and 3 copies of the expression BOX time_period?
    What is a good description of the problem?

    To start, you can use aliases for columns in the ORDER BY clause. Unfortunately, it's the only place where you can use column aliases in the same query, where they are defined . You can calculate them in a query-sib and then use them in queries Super.
    In other words, wouldn't be nice if we had a table just like op_detail, but with an extra column called wctr? Make a view: either a regular view (especially if wctr, calculated in the same way, to be used for several different queries) or view online, as shown below.
    Wouldn't be great if there was a table that was like a, except that he had calculated alreay time_period? Make a view: either a regular view, or a view online, as shown below.

    SELECT     o.part_nbr
    ,     s.major_seq_nbr          AS op_nbr
    ,     s.wctr
    ,     MIN(s.plan_su_rsrc)          AS min_plan_setup
         -- lots of other agtgregates go here in real query
    ,     a2.time_period
    FROM     ord_master      o
    ,     (          -- Begin in-line view s, with data from op_detail
                 SELECT  op_detail.*      -- or list all columns needed in main query
              ,     CASE          -- replace similar-to wctr_id's with a single new wctr_id, so we can treat them as the same
                       WHEN     wctr_id        IN ('H211','H212')
                       THEN     'Z211'
                       ELSE     wctr_id
                   END                    AS wctr
              FROM     op_detail
         ) s          -- End in-line view s, with data from op_detail
    ,     (           -- Begin in-line view a2, to compute time_period
              SELECT  a.*
              ,     CASE
                       WHEN ord_min_start     >     ADD_MONTHS(SYSDATE,-12)
                           THEN     '12 mos. back'
                           WHEN ord_min_start     >     ADD_MONTHS(SYSDATE,-24)
                           THEN     '24 mos. back'
                           WHEN ord_min_start     >     ADD_MONTHS(SYSDATE,-36)
                           THEN     '36 mos. back'
                           ELSE '37 mos. back +'
                   END                         AS time_period
              FROM     a          -- in real query, a is an in-line view
         ) a2          -- End in-line view a2, to compute time_period
    WHERE     o.ord_nbr     = s.ord_nbr
    AND     o.sub_ord_nbr     = s.sub_ord_nbr
    AND     o.ord_nbr     = a2.ord_nbr
    AND     o.sub_ord_nbr     = a2.sub_ord_nbr
    AND     o.ord_type     = 'AA'
    AND     o.ord_stat     IN ('CL','OP')
    AND     s.oper_stat     IN ('CL','CP')
    GROUP BY     o.part_nbr
    ,          s.major_seq_nbr
    ,          s.wctr
    ,          a2.time_period
    ORDER BY     o.part_nbr
    ,          a2.time_period
    ,          s.major_seq_nbr
    ;
    

    In your example, wctr is identical to wctr_id, except for two values. If it was more complicated (for example, if there is not only 2 values that must be mapped on 'Z211', but also 3 to did not amount to "Z987", and 1 which should be treated as "A012" and 5 who should appear as "A666" and...), then you pourriez encode this in an expression BOX humongeous (one nested expression BOX if it involves more than 128 branches) , but it actually belongs to a table, where you have the gross wctr_id (such as "H211") in a column and its equivalent correspondent (for example "Z211") in another. I know that you said that you cannot create new tables; I'm just pointing out that then you can tell people that won't let you create tables, it's a bad idea, likely to lead to errors and some time in the future.

  • Apple Extreme, Time Capsule and Express on the same system, what is the best way to set it up so that all devices smoothly from one end of the House to another?

    Apple Extreme, Time Capsule and Express on the same system, what is the best way to set it up so that all devices smoothly from one end of the House to another?

    I'm going to assume that you plan to have wireless devices.

    Let's say that the Capsule is your "main" router  If this is the case, then it must be located in the House, so that the distance between the time Capsule is the same for the outside walls of the House.

    Then, on the 'left' side of the House, looking for an airport to midway between the Capsule and time of the outer wall of the House. Do the same thing the 'right' side of the House.

    In other words, each of the two airports that "extend" the wireless signal are located at equal distance from the Capsule of time... but they are in opposite ends of the House.

    If you intend to interconnect all the airports and Time Capsule using a permanent, Ethernet wired... which by far is the 'best' way to put in place a network in terms of performance and reliability... then you can locate one of the devices anywhere you want.

  • the Boolean value 'specify by the expression' in the call of the sequence

    Hello

    Is it possible to set the checkbox "Specify by the expression" in a statement?

    The statement should be in the cleanup.

    If Yes, what is the line of code to write? because this variable is not

    the window variable so I have no idea on how to fix this Boolean value.

    Thank you

    An expression similar to the following should work:

    "" "RunState.Sequence.Main ["myseqcall"]." Module.AsSequenceCallModule.SpecifyByExpr = true

    -Doug

  • Is it possible to connect a simple 1 d array to a digital indicator or what would be the best way to display the numeric values of the array on the front panel?

    Is it possible to connect a simple 1 d array to a digital indicator or what would be the best way to display the numeric values of the array on the front panel? Examples or suggestions would be greatly appreciated.

    Thank you

    Tunis

    Thank you Adam, it's originally in a while loop, I placed it in a loop for example, wired County in the for loop and presto, this son of a digital indicator. It works very well. Thanks for the help folks.

  • Best way to update table attribute with one value calculated from another table JDeveloper

    I have a simple chart. Payment: Payment_Product = Master: detail.

    So first of all, I have to insert in payment, then in Payment_Product. TotalSum default value is null. After validation, I want TotalSum must be calculated according to Product.Price and Payment_Product.Quantity.

    What is the best way to do this in JDeveloper (12.1)?

    payment_product.jpg

    The best way to do that will not do.

    Don't store calculates the basic values unless you have checked, it improves the speed. Otherwise, this will cause almost always more trublen that she enjoys.

    Calculate this total when you do the report. At this point, you have several aggregate function build SQL where sum() is one of them...

    Good bye

    DPT

  • the best way to deal with the changed values maskMode?

    Hi people

    I just found out that the values listed for maskModes have changed between CC14 and CC15 who broke most of my scripts of masking.

    IE MaskMode.ADD in CC14 has the value 6413 but CC15 is 6813.

    What is the best way to deal with this? is there a simple solution or what I need to check the version of AE which is used and adjust from there?

    is there a direct way to access the name ie "MaskMode.ADD" instead of the value?

    Thanks... /JL

    To get the string maskMode by the current mask, you can loop through all the values possible maskmodes and stop when you click on:

    for (var k in MaskMode){
        if (myMask.maskMode === MaskMode[k]) break;
        };
    // at this stage k is the maskMode string (eg: "ADD")
    

    Xavier

Maybe you are looking for

  • Is it possible to spend in Firefox 4 on a machine running Mac OS 10.4.11?

    I can't upgrade my OS as our machines (Mac mini with 1 GB of RAM) do not have CPU Pentel needed for the OS 'Snow Leopard', and although I can DL the installation of programs for FF4, I am prevented from dragging and dropping them in my Applications f

  • How to transfer files from old PC of office to the new Satellite L750?

    Hi everyone - starting at this site so be gentle with me please. Specifically, I want to ask: (a) Will the MS Word 7 Starter, which is already installed on my computer Toshiba laptop accept a lot of files from my old Desk Top for most Word documents?

  • Comfort Curve Keyboard 2000

    Hello I have a Comfort Curve Keyboard 2000 and the major keyboard works, except for the letter c C I checked to update the drivers and it says that it is up-to-date The keyboard is clean and not stcky so I am rather frustrated > I use copy and paste

  • Need a "Filmy" software for Camcorder HDR-CX130

    I bought a HDR-CX130 last year, and in one of the information documents, he said that I can download 'Filmy' on the PlayStation Store can watch AVCHD movies in my computer. However, I couldn't find anything on Filmsy in this web site. Do you have any

  • My Alienware does not start

    Hello. Yesterday I played a few games whit my new computer. Today morning, that it does not start when I am pressing the start button. Just a dim on the button and I can hear the motor trying to start but turns like a car. This computer is less than