What SYS tables (not seen) contains the value NULL spec /not/ column definition?

What SYS (or tables) store the value of a spec /not/ NULL columns? (It doesn't seem to be COL$)

NOTE: This is NOT a trick question - although it seems to be.

Test configuration:
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE     11.2.0.1.0     Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Test configuration:
1. a table is created by SCOTT in the SCOTT schema with a NULLABLE column.

2. a primary key constraint is added using only the NULLABLE column

3. Requests for information on USER_TAB_COLS, ALL_TAB_COLS, DBA_TAB_COLS and SYS. COL$ see NOT NULL for the column NULLABLE
as necessary for a primary key constraint. Views derive their data from the column of $ NULL the sys. Table of $ COL
using
'DECODE (SIGN (c.null$), -1, 'D', 0, 'Y', 'N'),
and the table of $ COL shows a numerical value of '0' before you add the primary key and a value of "1" later.

4. a query on the DDL metadata table shows the specification for column NULLABLE of origin involved.

Question - where this original specification NULLABLE is stored?

This question is based on a question asked by another user in this thread
Columns becoming nullable after a fall of primary key?

I created the following specially for that matter test case
-- scott ensures table does not exist
DROP TABLE tbl_test CASCADE CONSTRAINTS;

-- scott creates a table
CREATE TABLE tbl_test ( col_1 NUMBER,
col_2 NUMBER NOT NULL);

-- scott queries to check the the column nullable status
SELECT table_name, column_name, nullable 
FROM user_tab_cols
WHERE table_name = 'TBL_TEST';

-- TABLE_NAME | COLUMN_NAME | NULLABLE
-- TBL_TEST   | COL_1       | Y 
-- TBL_TEST   | COL_2       | N 

-- Scott addes a primary key constraint using only the nullable column
ALTER TABLE tbl_test ADD CONSTRAINT tbl_test_pk PRIMARY KEY(col_1);

-- scott queries to check the the column nullable status
SELECT table_name, column_name, nullable 
FROM user_tab_cols
WHERE table_name = 'TBL_TEST';

TABLE_NAME,COLUMN_NAME,NULLABLE
TBL_TEST,COL_1,N
TBL_TEST,COL_2,N

-- scott queries to get the table DDL
select dbms_metadata.get_ddl('TABLE', 'TBL_TEST', 'SCOTT') FROM DUAL;

DBMS_METADATA.GET_DDL('TABLE','TBL_TEST','SCOTT')

  CREATE TABLE "SCOTT"."TBL_TEST" 
   (     "COL_1" NUMBER,                   <------ where is this NULLABLE spec stored? 
     "COL_2" NUMBER NOT NULL ENABLE, 
      CONSTRAINT "TBL_TEST_PK" PRIMARY KEY ("COL_1")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOCOMPRESS LOGGING
  TABLESPACE "USERS"  ENABLE
   ) SEGMENT CREATION DEFERRED 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  TABLESPACE "USERS" 
The DOF shows that Oracle keeps the original spec NULLABLE for the column and uses it to generate the DDL orginal, even if there is a primary key on the table and the system views (and COL$) show the column non NULLABLE.

So where is the original information NULLABLE actually stored?

rp0428 wrote:
What SYS (or tables) store the value of a spec /not/ NULL columns? (It doesn't seem to be COL$)

I think that it becomes a bit messy depending on order of activity:

You can see Col. .null$ is set to a non-zero when the desrcibe command displays the column as not null, but it can happen for two reasons:
(a) user sets the column as not null - in which case you get a line in cdef$ with type # = 7
(b) the user adds a primary key to table - in which case you get a line in cdef$ with type # = 2

If you declare null AND add a primary key, you get two lines - that's why it is possible for Oracle to determine if he should remove the flag not null when you remove the primary key and also allows dbms_metadata show the create statement of table without a NOT NULL even when describe it the watch with a NOT NULL - dbms_metadata can respond to the presence of the type # = 2 and absence of the type # = 7.

Concerning
Jonathan Lewis

By the way: by a strange coincidence, it seems to me answering the previous post, three days before it was asked: http://jonathanlewis.wordpress.com/2012/04/19/drop-constraint/#comment-46140 (on the doubts, this isn't - it answers a different question on the removal of constraints).

Published by: Jonathan Lewis April 23, 2012 11:07

Tags: Database

Similar Questions

  • Would like to know which table in the repository contains the value of the operating system

    Hello

    I would like to know which table in the repository contains the value of "Owner operating system".

    Any ideas.

    Thank you
    Paul

    The following query should help you:

    SELECT t.target_name agent_name, cm.string_value mgmt_targets Os_User t, mgmt_metrics m.
    cm mgmt_current_metrics WHERE t.target_type = 'oracle_emd. '
    AND m.target_type = 'oracle_emd' AND t.target_guid = cm.target_guid AND cm.metric_guid = m.metric_guid
    AND m.metric_name = 'EMDIdentity' AND m.metric_column = 'username' AND m.type_meta_ver = t.type_meta_ver;

    Best regards
    Vincent

  • Creating a variable that contains the value of the variable system (Long) Date of change

    Can someone tell me how to write a script to create a variable named DocDate, which contains the value of the variable of system (Long) Date of change? Or write a script that creates a variable named DocDate, which contains the current date? I can't find a lot of documentation on scripting ExtendScript.

    Hi Julee, when you create a user variable in the interface, you cannot include the building blocks of time in the definition. They can only be used in system like the System Date of Modification (Long) variable variables. So the question is, why not just use the variable Date of change (Long) system in your document? What is the purpose of the variable user DocDate? Let me know what you think here, and I can try to help you.

    Here are some ExtendScript resources:

    My blog: FrameAutomation.com | FrameMaker, faster and more effective to

    Debra Herman blog: Extension of FrameMaker

    The large samples of Russ Ward: FrameMaker ExtendScript samples - West Street Consulting

    -Rick

  • How do I click on a cell in a table control and display the value in a string?

    What I want to do is click on a cell in a table control and have the value of the cell in an indicator of the chain. Cell that ever I click on, I wish that the value to be displayed in the indicator.

    Thank you!

    Use the property "Change Position".

  • Siri in him sending text with the value 'NULL '.

    When I say, "Siri, text my wife, 'X', ' Siri responds correctly,"here is your message to Jill: 'X'. "" "  "Ready to send it?"  I say 'Yes' and sends the message.  As soon as I get a text from my carrier saying the recipient of the message was invalid.  100% of the time, I see that Siri has sent a text with the value NULL.

    I tried to restart my phone.  I tried to remove and re-add my contacts.  Anyone else having this problem?  Someone knows how to solve?

    If it's by the carrier, you should contact them and see what they receive in return for their side. Ive had Siri send messages for me and I have never seen this one IOS.

  • using the value null with a function

    Guys, newbie here

    What is the value NULL in function header? Does this mean that I can pass a value zero?

    FUNCTION tot_sales

    (company_id_in IN company.company_id%TYPE,

    status_in IN order.status_code%TYPE: = NULL)

    RETURN NUMBER

    Hello

    dorianpc wrote:

    Guys, newbie here

    What is the value NULL in function header? Does this mean that I can pass a value zero?

    FUNCTION tot_sales

    (company_id_in IN company.company_id%TYPE,

    status_in IN order.status_code%TYPE: = NULL)

    RETURN NUMBER

    You can always pass NULL for any argument.

    What does this code mean, is that the argument is optional (what, you don't have to spend), and if you do not pass it, status_in will be NULL inside the function.

    So call for your function with 1 argument, like this:

    t: = to_sales (c);

    is equivalent to calling with 2 arguments, like this

    t: = to_sales (c, NULL);

    where the 2nd argument is null.

  • Divide the values of a single column into multiple values of columns

    I want that the values of the "col_val" column to divide into several values in the column

    Table1:

    Col_val Col1, Col2

    Code1 POINT 45

    L2 AB 45

    L1 POINT 45 OF

    Code2 CAB 61

    ABC 51 LABORATORY

    SSS LAB 45

    QQQ BED 123

    BBV COT 100

    FFF COT 444

    Output as expected:

    OUT1 out2 out3-out4, out5

    Code1 AB SSS

    L1

    Code2

    ABC

    QQQ

    BBV

    FFF

    Each line must contain the values corresponding to the Col2 values and each column must have the values in Col1, as illustrated above.

    SQL> with t
      2  as
      3  (
      4  select 'Code1' col_val, 'ITEM' col1, 45 col2
      5    from dual
      6  union all
      7  select 'L2' col_val, 'AB' col1, 45 col2
      8    from dual
      9  union all
     10  select 'L1' col_val, 'ITEM' col1, 45 col2
     11    from dual
     12  union all
     13  select 'Code2' col_val, 'CAB' col1, 61 col2
     14    from dual
     15  union all
     16  select 'ABC' col_val, 'LAB' col1, 51 col2
     17    from dual
     18  union all
     19  select 'SSS' col_val, 'LAB' col1, 45 col2
     20    from dual
     21  union all
     22  select 'QQQ' col_val, 'COT' col1, 123 col2
     23    from dual
     24  union all
     25  select 'BBV' col_val, 'COT' col1, 100 col2
     26    from dual
     27  union all
     28  select 'FFF' col_val, 'COT' col1, 444 col2
     29    from dual
     30  )
     31  select max(col1)
     32       , max(col2)
     33       , max(col3)
     34       , max(col4)
     35       , max(col5)
     36    from (
     37            select decode(col1, 'ITEM', col_val) col1
     38                 , decode(col1, 'AB'  , col_val) col2
     39                 , decode(col1, 'LAB' , col_val) col3
     40                 , decode(col1, 'CAB' , col_val) col4
     41                 , decode(col1, 'COT' , col_val) col5
     42                 , t.col2 col_2
     43                 , row_number() over(partition by col2, col1 order by 1) rno
     44              from t
     45         )
     46   group
     47      by col_2, rno
     48   order
     49      by col_2;
    
    MAX(C MAX(C MAX(C MAX(C MAX(C
    ----- ----- ----- ----- -----
    Code1 L2    SSS
    L1
                ABC
                      Code2
                            BBV
                            QQQ
                            FFF
    
    7 rows selected.
    
    SQL>
    
  • Calculated field with the currency formatting, and hiding the values null

    I am designing a PDF form for quote and I have a field defined to multiply the amount of an article and the unit price to the total price.  There are 5 lines on each quote, and if users are citing only 1 or 2 items I want the values null in fields unused price extended to be hidden.

    I did it with the following script

    If (event.value == 0) event.value = ";

    But when I enter the quantity and total price of price is displayed as a regular number (100) instead of currency ($100).

    I can format to currency with

    Event.Value = util.printf ("$%.2f", event.value);

    I don't know there's a way to combine to give rise to such a situation then, so if the field is 0, make null and if not then format as currency but I don't know how to do it.

    Any help would be appreciated.

    Andrew

    Newer versions of Acrobat hide zero for fields values using the number format and with a currency symbol. »

    But since you can't control the updating of user systems, you must use a small function documented for formatting numeric fields on the fly.

    With the extended price field set to 'None' format, you can add the following script to the Validation script "Custom" or add it to a custom JavaScript calculation. The "Custom Validation will work with any method of calculation. Note that the form must be cleaned or recalculated to see the result of the validation script change.

    if(Event.Value == 0) {}
    Event.Value = ""; set the field value to null to a value of zero
    AFNumber_Format (2, 0, 0, 0, "", true); number with no currency symbol format
    } else {}
    AFNumber_Format (2, 0, 0, 0, "$", true); for the format of the values non-null for number with the currency symbol
    }

    The positional parameters are the number of decimal places, the Style separator, negative value Style, Style of (unused) currency, currency symbol, the currency symbol Pre-hanging chain.

  • Compare the value Null

    Hello

    Is it possible to compare a null to null...

    Example of
    ---------------------------
    Indicator number;

    If null = null then
    flag = 1;
    on the other
    flag = 0;
    end if;
    ---------------------------

    Thank you.

    Hello

    Use "is null".

    For example:

    declare
    VARCHAR2 (10) variable;
    Start
    If the variable is null then
    dbms_output.put_line ('variable is null');
    on the other
    dbms_output.put_line ("'variable is non-zero");
    end if;
    end;

    By comparing the value null = null will not work.

  • What is the empty string, the value null in the column, or...?

    I use Oracle 11.2, a table tb_class as follows:

    TB_CLASS (number (3) id, varchar2 (32) nm, seqNum number (3));

    1, 212
    2, "under", 12
    3, 'qq', 12

    Select * from TB_CLASS where id = 1 and n = null;... .no selected line
    Select nvl (nm) in the TB_CLASS where id = 1; ... 1 selected line

    Any know what's in the column of row id = 1 nm? I thought that it is an empty string, but why it returns no rows in the first query?

    Thank you!

    (1) in Oracle there is no difference between NULL and an empty string.

    (2) NULL is never equal to what whatsoever (including another NULL). NULL is never spotty what whatsoever (including another NULL). You must use the IS NULL and IS NOT NULL operators to search for NULL values

    SELECT *
      FROM tb_class
     WHERE nm IS NULL
    

    or

    SELECT *
      FROM tb_class
     WHERE nm IS NOT NULL
    

    Of course, it is also possible that you declare that the NM column contains one or more spaces or it contains one or more non-printable characters and not a NULL value. That's why we asked you what dump (nm) returns

    Justin

  • Delete data table Parent and child data automatically delete or the value null in the foreign key of the child table.

    Oracle 10g

    Hi gurus

    I test_mst table that has a primary key test_mst.test_id, I detail table test_dtl which has test_dtl.test_id of foreign key, now I have that I want to use the delete statement in test_mst then it should also remove the constraint of her child or null in test_dtl.test_id, can again do in oracle 10g?

    Thanks in advance

    Hi Mit.

    example of cascade

    create table bill(
      bill_id number not null primary key
    )
    ;
    create table bill_item(
      bill_item_id number not null primary key,
      bill_id number references bill(bill_id) on delete cascade
    )
    ;
    insert into bill values (1)
    ;
    insert into bill_item values (1, 1)
    ;
    delete bill
    ;
    select * from bill_item
    ;
    drop table bill_item purge
    ;
    drop table bill purge
    ;
    
    Table BILL created.
    Table BILL_ITEM created.
    1 row inserted.
    1 row inserted.
    1 row deleted.
    
    no rows selected
    
    Table BILL_ITEM dropped.
    Table BILL dropped.
    

    exemplary null

    create table employer(
      employer_id number not null primary key
    )
    ;
    create table employee(
      employee_id number not null primary key,
      employer_id number references employer(employer_id) on delete set null
    )
    ;
    insert into employer values (1)
    ;
    insert into employee values (1, 1)
    ;
    delete employer
    ;
    select * from employee
    ;
    drop table employee purge
    ;
    drop table employer purge
    ;
    
    Table EMPLOYER created.
    Table EMPLOYEE created.
    1 row inserted.
    1 row inserted.
    1 row deleted.
    
                                EMPLOYEE_ID                             EMPLOYER_ID
    --------------------------------------- ---------------------------------------
                                          1                                       
    
    Table EMPLOYEE dropped.
    Table EMPLOYER dropped.
    
  • sum of column that contains the values in the time format

    Hi all

    I give you a piece of my code below
    SELECT  dif.EMPLOYEE_NUMBER Employee#, dif.FULL_name EmployeeName,
     TO_CHAR(START_DATE,'dd-Mon-rrrr') DOJ ,dif.DEPT_NAME,POSITION , DATE_ENTRAY AttendanceDate,
    
     to_char(DATE_ENTRAY,'DY') day, TO_CHAR(LNE1,'hh24:mi')TimeIn1 ,TO_CHAR(LNE2,'hh24:mi')TimeOut1,
     
     TO_CHAR(LNE3,'hh24:mi')TimeIn2 ,TO_CHAR(LNE4,'hh24:mi')TimeOut2, TO_CHAR(LNE5,'hh24:mi')TimeIn3 ,
    
     TO_CHAR(LNE6,'hh24:mi')TimeOut3, to_char(decode(LNE8,null ,
    
     decode(LNE7,null, decode(LNE6,null, decode(LNE5,null, decode(LNE4,null, decode(LNE3,null,
    
     decode(LNE2,null,LNE2 ,LNE2 ),LNE3 ),LNE4 ),LNE5 ),LNE6 ),LNE7 ),LNE8 ),'hh24:mi')TimeOuts ,
     
     ACT_HOUR Work_Hrs, 
    
    decode(DLY_ABSENT_TYPE,'Late',DED_ABS ,'Late (Deduction)',DED_ABS,'00:00') Late_Hrs,ACT_OVT Over_Time
     FROM jjj_PUNCH_DATA_EMP_LIST trn , 
     jjj_emp_def dif,jjj_PUNCH_CARD_ELEG ele WHERE trn.EMPLOYEE_NUMBER =dif.EMPLOYEE_NUMBER and   
     ele.EMPLOYEE_NUMBER =trn.EMPLOYEE_NUMBER  and   DATE_ENTRAY between '23-Aug-2009' and  '24-Aug-2009' 
    
    I require to find the sum of column  wrk_hrs
    Act_hour or wrk_hrs belongs to table  jjj_PUNCH_DATA_EMP_LIST trn , and the datatype of act_hour is varchar(10 byte)
    the values of column act_hrs, (i require the sum of this column)
    08:00
    07:22
    06:08
    kindly help
    thanking in advance

    concerning
    Oracle user

    Hello

    Thanks for posting the CREATE TABLE and INSERT. That really helps.

    Do you want 19:33 ' as the output? Which makes it look like 19 hours and 33 minutes. Most people would represent 19.33 hours (i.e. 19 more than 1/3 hours) as 19:20 '. Should not the sum of
    ' x: 00 ' and
    'y: 20' be
    "z: 20?

    If you really want 19:33 ', see the solution of Hoek.

    If you really want 19:20 ', then you were on the right track.
    I think that you were trying to do:

    WITH  got_total_hours     AS
    (
         SELECT SUM (   TO_NUMBER (SUBSTR (act_hour, 1, 2))
                    + ( TO_NUMBER (SUBSTR (act_hour, 4, 2))
                      / 60
                      )
                    ) AS total_hours
         from      p
    )
    SELECT        TO_CHAR (FLOOR (total_hours))
           || ':'
           || TO_CHAR ( MOD (total_hours, 1) * 60
                   , 'fm00'
                   )     AS hh_mm
    FROM     got_total_hours
    ;
    

    Looks like you were trying calculate total_hours in a subquery, then use the total_hour alias in a query Super, which is quite accurate. You're just confused on how to write a subquery.
    There are two basic ways to write subqueries:

    (1) WITH clause:

    WITH  sub_query  AS
    (
         SELECT  ...
    )
    SELECT  ...
    FROM      sub_query
    ;
    

    (2) online review

    SELECT     ...
    FROM     (     -- Begin sub_query
         SELECT     ...
         )     -- End sub-query
    ;
    

    Looks like you tried a bit of each method.

    In most cases (this included problem) either one will work.
    Other problems are much easier by using a WITH clause and WITH clauses are usually easier to read and understand, I recommend that you always use a WITH clause rather than views online.

    You can also change the Hoek solution to get the result 19:20 ' without a subquery (or without using any expression complicated, more than once, which is the only reason why I have proposed a subquery). Since date arithmetic Oracle comes from the days, not hours, when the solution of Hoek has calculated the number of hours, you'll have to divide by 24 to get the number of days. If you are using TO_CHAR to fit the time, however, the results can be confusing if the total is 24 hours or more. You might be better off using NUMTODSINTERVAL.

  • NET right in paywsacv.fmb contains the value after employee termination

    Hello

    Published by: user12046014 on April 19, 2011 13:53

    Hmm, that's strange. When you are so close to something, it is easy to slide up on a couple of obvious things. You can simply check:
    (1) this quick formula change was applied and saved
    (2) the formula change was not an update date of turn and these changes apply for the duration of the fast formula
    (3) that this Fast formula is defined as the rapid accumulation of the accumulation Plan form, looking to
    (4) that you have followed by date to a date beyond the date of termination of the employee
    (5) who in FastPath > accrued interest gross payment (the one on the first line of the retail block) is equal to zero

    If the foregoing is true I don't understand how your gross payment is zero. I see that your Fast formula looks like it has some sort of custom logging mechanism. This could be used to write the values of ACP_TERMINATION_DATE and Calculation_Date for us to verify that they are as expected?

  • The value of name of column

    Hi gurus

    I'm stuck on 1 Scenario and need your help. I have the following table:

    Create table

    drop table age_rate;

    CREATE TABLE age_rate
    (
    age_0_4 number 4,
    age_5_20 number 4,
    age_21_34 number 4,
    age_35_44 number 4
    );

    -------------------------------

    Insertion

    INSERT INTO age_rate

    SELECT 45, 50, 60, 90 double UNION ALL

    SELECT 45, 50, 60, 88 OF double UNION ALL

    SELECT the 40, 50, 60, 90 double UNION ALL

    SELECT 5, 50, 60 and 88 DOUBLE;

    -------------------------------

    Query on table

    SELECT * from age_rate;

    The query result

    age_0_4 age_5_20 age_21_34 age_35_44

    45                          50                     60                     90

    45                          50                     60                     88

    40                          50                     60                     90

    5                            50                     60                     88

    Power required

    Rate Min_age Max_age

    -The lower is age band 0_4

    45            0           4

    45            0           4

    40            0           4

    5              0           4

    -The lower is age band 5_20

    50            5           20

    50            5           20

    50            5           20

    50            5           20

    -The lower is age band 21_34

    60 21 34

    60 21 34

    60 21 34

    60 21 34

    -The lower is age band 35_44

    90 35 44

    88 35 44

    90 35 44

    88 35 44

    Rules

    -I have all the data in the rows each column online create separate lines and add 2 columns automatically Min_age and Max_age and insert the value on these columns based on the name of the column for example if the column name as age_0_4 then insert 0 in min_age and 4 in max_age means values for Min_age and Max_age extracted from the base of the column name. I don't know if it's possible or not, but I appreciate if someone can give me the solution for this problem... Do you like answers. Thank you


    Hello

    I'm not 100% sure what you want.  Do you want 16 production lines at a time, which is 4 lines of output for each line that is actually in the table?

    This looks like a job for the UNPIVOT operator:

    SELECTION rate

    min_age

    Case min_age

    WHEN 0 THEN 4

    WHEN 5 THEN 20

    WHEN 21 AND 34

    WHEN 35 THEN 44

    END AS max_age

    Of age_rate

    UNPIVOT (rate

    FOR min_age IN (age_0_4 0)

    age_5_20 AS 5

    age_21_34 AS 21

    age_35_44 AS 35

    )

    )

    ORDER BY min_age

    ;

  • Group by to ignore the values null

    Hi all
    Oracle version 10 g 2
    Consider the scenario

    Table: point
    Columns: Itm_id, Itm_type, appl_y_n (VALUES VALID 'Y', ' n, NULL)

    I HAVE FOLLOWING ITEM TYPES.

    TYP1
    TYP2
    TYP3

    In this appl_y_n is applicable only to the item type typ1 and it can contain y, n, or null.
    Types of remaining elements of this field may contain any value, including null, but I want to ignore these values.
    ITM_ID     ITM_TYPE     APPL_Y_N
    1     TYP1     NULL
    2     TYP1     Y
    3     TYP1     N
    4     TYP2     NULL
    5     TYP2      NULL
    6     TYP3     NULL
    7     TYP3     NULL
    now I need a group of clause which must ignore values null to appl_y_n only for TYP1

    on top of the sample output must be
    ITM_TYPE     APPL_Y_N     CNT
    TYP1     YES     1
    TYP1     NO     1
    TYP2     NULL     2
    TYP3     NULL     2
    Query, that I use for this:

    Select ITEM_TYPE, COUNT (ITM_ID), decode (itm_type, 'TYP1', DECODE(APPL_Y_N,'Y','Yes','N','No')) APPL_Y_N
    of the order of the day
    Item_type group, decode (itm_type, 'TYP1', DECODE(APPL_Y_N,'Y','Yes','N','No'))

    But he's considering typ1 as null values.

    Please give me a solution that ignores null values

    Thanks in advance
    NM

    Hello

    Check the below. It will be useful.

    SQL >
    SQL > WITH t AS)
    2 SELECT 2 ITM_ID, 'TYP1' ITM_TYPE, 'Y' APPL_Y_N FROM dual UNION ALL
    3. SELECT 3 ITM_ID, 'TYP1' ITM_TYPE, "n" APPL_Y_N FROM dual UNION ALL
    4. SELECT 1 ITM_ID, 'TYP1' ITM_TYPE, APPL_Y_N NULL FROM dual UNION ALL
    5. SELECT 4 ITM_ID, "TYP2' ITM_TYPE, APPL_Y_N NULL FROM dual UNION ALL
    6. SELECT 5 ITM_ID, "TYP2' ITM_TYPE, APPL_Y_N NULL FROM dual UNION ALL
    7. SELECT 6 ITM_ID, "TYP3' ITM_TYPE, APPL_Y_N NULL FROM dual UNION ALL
    8. SELECT 7 ITM_ID, "TYP3' ITM_TYPE, APPL_Y_N double NULL)
    9 SELECT itm_type,
    10 DECODE (itm_type, 'TYP1', DECODE (appl_y_n, 'Y', 'Yes', "n","no")) appl_y_n,.
    11 COUNT (itm_id)
    12 FROM t
    13 WHERE NOT (itm_type = 'TYP1' AND APPL_Y_N IS NULL)
    14 group of itm_type,
    15 decode (itm_type, 'TYP1', DECODE (APPL_Y_N, 'Y', 'Yes', "n","no"))
    16 ORDER BY itm_type
    17.

    ITM_TYPE APPL_Y_N COUNT (ITM_ID)
    -------- -------- -------------
    TYP1 NO. 1
    TYP1 Yes 1
    TYP2 2
    TYP3 2

    SQL >

    Rgds
    Ameya

Maybe you are looking for

  • prohibitive gray screen, but the start of the option works

    I have a strange here. Early 2011 MBP - OSX 10.10.5. Everything was fine with the computer, and then all of a sudden the small wheel of death... computer slows down to a stop and then screen black. At startup - gray screen, blinking prohibitory sign

  • error blockstate.VI

    Hello! I have a cDaq9172 with the NI9217 module. I use it for the Pt100 measurement and it works well for years now. I do not change the configuration of the computer, do not installed new drivers (as far as I know, others not so), has not changed so

  • Envy of HP Touchsmart m7-J120Dx: help please - Factory Reset failed on HP Envy

    Recently, my touch screen laptop was suffering from extreme "ghost key" that made the laptop basically unusable until what I disabled the human and used only the mouse interface. I went on a popular site that has accompanied me through many scans det

  • Solid State drive Samsung 850 Pro

    I want to add an SSD Samsung 850 Pro for a HP Pavilion Elite e9280t intel i7 - 920 (2.66 ghz, 1 MB L2 + 8 MB of cache shared N3), 2 TB 7200 RPM / min SATA 3 gb/s - two 1 TB hard drives. An SSD will work with my setup?  Thank you Gary

  • Smartphones blackBerry torch files disappear

    My torch continues to lose my files that require a battery to restore/being seen pull.  This usually happens after a few hours of use. I created a download folder and placed most of my 3rd party apps there and she disappears as well.  While I can scr