Query to find distinct records based on different roles of single table

Hello to all the gurus,

I have a table structure such as
Unique Student_ID can have several attributes - teacher, University, sports.

My request is to retrieve the total number of those students who have the combination of the value of the attribute of all (i.e. students who is an instructor/Professor/sports, but also the scholar)

SELECT distinct (Student_ID) OF student_role_INDICATORS where Student_ID in
(
SELECT Student_ID FROM student_role WHERE ATTR_VAL =' teacher '
Union
SELECT Student_ID FROM student_role WHERE ATTR_VAL =' Monitor'
Union
SELECT Student_ID FROM student_role WHERE ATTR_VAL =' sports '
Union
SELECT Student_ID FROM student_role WHERE ATTR_VAL =' scholar '
)

But it gives me the correct results.


I tried to use the case as - options

SELECT count (distinct Student_ID) of student_role_INDICATORS
CASE
WHEN ATTR_VAL = 'Teacher' AND ATTR_VAL = 'Monitor' AND ATTR_VAL = 'Athlete' AND ATTR_VAL = 'scientist '.
THEN '1'
ELSE ' 0'
END

But SQL does not.

Kindly help me. Thanks in advance.

Hello

The query I posted above shows all the students who have the combination of the value of the attribute of all (i.e. students who is an instructor/Professor/sports, but also the scholar). I forgot that you asked their County (their total number). So, to get the total number of those students who have the combination of the value of the attribute of all (i.e. students who is an instructor/Professor/sports, but also the scholar), just change the query I posted below:

SELECT count(distinct (Student_ID)) FROM student_role_INDICATORS where Student_ID in
(SELECT Student_ID FROM student_role WHERE ATTR_VAL=' Teacher'
)
and  Student_ID in
(SELECT Student_ID FROM student_role WHERE ATTR_VAL=' Monitor')
and Student_ID in
(SELECT Student_ID FROM student_role WHERE ATTR_VAL=' Sportsman')
and  Student_ID in
(
SELECT Student_ID FROM student_role WHERE ATTR_VAL=' Scholar'
)

Note: I just added County to the query I posted in my first answer.

Tags: Database

Similar Questions

  • SQl query to find out time between the different lines of transactions

    (See both images from an attachment to get the clear picture of the data and understand the question correctly.)

    I have a set of data like this in one of my paintings. (This is a simple representation of the original data.)

    Reference table1.jpg

    Id        | Type               | Value | Start_date | End_date

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

    ZTR0098 | ALLOW | 0 | 1 JUN | 2 JUN |

    ZTR0098 | ADTAX | 0 | 1 JUN | 2 JUN |

    ZTR0098 | MXTAX | 0 | 1 JUN | 9 JUN |

    ZTR0098 | ALLOW | 4. 3 JUN | 15 JUN |

    ZTR0098 | ADTAX | 44.00 | 3 JUN | 17-JUNE |

    ZTR0098 | MXTAX | 2. 10 JUN | 17-JUNE |

    ZTR0098 | ALLOW | 5. 16-JUNE | 20 JUN |

    ZTR0098 | ADTAX | 55,34 | 18 JUN | 22 JUN |

    ZTR0098 | MXTAX | 1. 18 JUN | 25 JUN |

    ZTR0098 | MXTAX | 6. 26 JUN | 31 AUG |

    ZTR0098 | ADTAX | 20.09. 23 JUN | 23 JUL |

    ZTR0098 | ALLOW | 8. 21 JUN | 31 AUG |

    ZTR0098 | ADTAX | 45. 24 JUL | 31 AUG |

    each line has a type and a rasthaus id to it. ID belongs to other parent tables. the value of each type is given, and the validity of each value is followed by a field start_date and end_date.

    All values start from 1 - JUN and expires on 31 - AUG. Now my requirement is to obtain a report that gives three columns for three different types (ALLOW, ADTAX and MXTAX) with combination of unique values in the effective time interval. Let me put the result below.

    Reference table2.jpg

    Id         | ALLOW | ADTAX | MXTAX |  Start_date | End_date

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

    ZTR0098 | 0 | 0 | 0 | 1 JUN | 2 JUN |

    ZTR0098 | 4. 44.00 | 0 | 3 JUN | 9 JUN |

    ZTR0098 | 4. 44.00 | 2. 10 JUN | 15 JUN |

    ZTR0098 | 5. 44.00 | 2. 16-JUNE | 17-JUNE |

    ZTR0098 | 5. 55,34 | 1. 18 JUN | 20 JUN |

    ZTR0098 | 8. 55,34 | 1. 21 JUN | 22 JUN |

    ZTR0098 | 8. 20.09. 1. 23 JUN | 25 JUN |

    ZTR0098 | 8. 20.09. 6. 26 JUN | 23 JUL |

    ZTR0098 | 8. 45. 6. 23 JUL | 31 AUG |

    As you can see there are no duplicate rows for a combination of (ALLOW, ADTAX and MXTAX) with their respective dates in force. resulting in the above table. the first step is to convert lines to the column which is pretty obvious to do that by grouping on start_date and end_date colum, but the real deal is the time interval during which the combination of the values (ALLOW, ADTAX, and MXTAX) has remained constant.

    I wrote under query using Group by.

    Select

    ID,

    NVL (max (decode (type, "ALLOW", value)), 0) as ALLOW

    NVL (max (decode (type, 'ADTAX', value)), 0) as ADTAX

    NVL (max (decode (type, 'MXTAX', value)), 0) as MXTAX

    Start_date,

    End_date

    from my_table

    Group of start_date, end_date, id

    start_date, end_date

    the results it gives are like this:

    Reference table3.jpg

    Id       | ALLOW | ADTAX | MXTAX |  Start_date | End_date

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

    ZTR0098 | 0 | 0 | 0 | 1 JUN | 2 JUN |

    ZTR0098 | 0 | 0 | 2. 1 JUN | 9 JUN |

    ZTR0098 | 4. 0 | 0 | 3 JUN | 15 JUN |

    ZTR0098 | 0 | 44.00 | 0 | 3 JUN | 17-JUNE |

    ZTR0098 | 0 | 0 | 2. 10 JUN | 17-JUNE |

    ZTR0098 | 5. 0 | 0 | 16-JUNE | 20 JUN |

    ZTR0098 | 0 | 55,34 | 0 | 18 JUN | 22 JUN |

    .   .

    . .

    like wise

    but I'm not able to determine the time intervals by using the SQL query.

    with

    Table1 as

    (select the id 'ZTR0098', 'ALLOW' type, 0 val, to_date('1-JUN','dd-MON') start_date, end_date Union to_date('2-JUN','dd-MON') double all the)

    Select 'ZTR0098', 'ADTAX', 0, to_date('1-JUN','dd-MON'), to_date('2-JUN','dd-MON') of all the double union

    Select 'ZTR0098', 'MXTAX', 0, to_date('1-JUN','dd-MON'), to_date('9-JUN','dd-MON') of all the double union

    Select 'ZTR0098', 'ALLOW', 4, to_date('3-JUN','dd-MON'), to_date('15-JUN','dd-MON') of all the double union

    Select 'ZTR0098', 'ADTAX', 44.00, to_date('3-JUN','dd-MON'), to_date('17-JUN','dd-MON') of all the double union

    Select 'ZTR0098', 'MXTAX', 2, to_date('10-JUN','dd-MON'), to_date('17-JUN','dd-MON') of all the double union

    Select 'ZTR0098', 'ALLOW', 5, to_date('16-JUN','dd-MON'), to_date('20-JUN','dd-MON') of all the double union

    Select 'ZTR0098', 'ADTAX', 55.34, to_date('18-JUN','dd-MON'), to_date('22-JUN','dd-MON') of all the double union

    Select 'ZTR0098', 'MXTAX', 1, to_date('18-JUN','dd-MON'), to_date('25-JUN','dd-MON') of all the double union

    Select 'ZTR0098', 'MXTAX', 6, to_date('26-JUN','dd-MON'), to_date('31-AUG','dd-MON') of all the double union

    Select 'ZTR0098', 'ADTAX', 20.09, to_date('23-JUN','dd-MON'), to_date('23-JUL','dd-MON') of all the double union

    Select 'ZTR0098', 'ALLOW', 8, to_date('21-JUN','dd-MON'), to_date('31-AUG','dd-MON') of all the double union

    Select 'ZTR0098', 'ADTAX', 45, to_date('24-JUL','dd-MON'), to_date('31-AUG','dd-MON') of the double

    ),

    days like

    (select level - 1 dte + to_date('1-JUN','dd-MON')

    of the double

    connect by level<= to_date('31-aug','dd-mon')="" -="" to_date('1-jun','dd-mon')="" +="">

    )

    Select id, allow, adtax, mxtax, min (dte) start_date, max (dte) end_date

    (select ID, dte, max (allow) allow, max (adtax) adtax, max (mxtax) mxtax,

    ROW_NUMBER() over (order by dte) row_number() - courses (partition by order max (allow), max (adtax), max (mxtax) by dte) gr

    go (select id, dte,

    -case when type = 'ALLOW' and dte between start_date and end_date then end val 0 otherwise allow.

    -case when type = "ADTAX" and dte between start_date and end_date then val 0 otherwise end adtax.

    -case when type = "MXTAX" and dte between start_date and end_date then val 0 otherwise end mxtax

    Table 1 t,

    days d

    where d.dte between t.start_date and t.end_date

    )

    Group by id, dte

    )

    Group by id, gr, allow, adtax, mxtax

    order by id, gr

    ID ALLOW ADTAX MXTAX START_DATE END_DATE
    ZTR0098 0 0 0 01/06/2015 02/06/2015
    ZTR0098 4 44 0 03/06/2015 09/06/2015
    ZTR0098 4 44 2 10/06/2015 15/06/2015
    ZTR0098 5 44 2 16/06/2015 17/06/2015
    ZTR0098 5 55,34 1 18/06/2015 20/06/2015
    ZTR0098 8 55,34 1 21/06/2015 22/06/2015
    ZTR0098 8 20.09 1 23/06/2015 25/06/2015
    ZTR0098 8 20.09 6 26/06/2015 23/07/2015
    ZTR0098 8 45 6 24/07/2015 31/08/2015

    Concerning

    Etbin

  • Query to find the sum of the different groups in the same column

    Hello

    I have a table as follows:



    visitors
    ------------------------------------------------------------------------------------------
    months of amt credit CustID
    --------------------------------------------------------------------------------------------
    001 C 2000-Jan-2012

    001D 5000 Feb 2012

    001C 3000 Mar-2012

    001C 3000-Apr-2012

    001D 7000-may-2012



    I have to write a single query to calculate the sum of the credit and the sum of the flow values separately.


    Thank you and best regards,
    SB2011

    Hello

    Select decode (credit,' it, sum (amt), sum (amt)) in the Group of customers to credit;

    Published by: 937440 on 24 February 2013 07:06

  • Separate records, based on the condition of a table

    Hello PL/SQL gurus and experts.

    I use Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64-bit Production version
    I have table-

    Note - Table do not have a primary key on Order_ID.
    DROP TABLE T;
    create table T(Order_ID,Active_Flg) as select
    '201002', 'Y' from dual union all select
    '201002', '' from DUAL union all select
    '201003', '' from dual union all select
    '201004', 'Y' from DUAL union all select
    '201004', '' from dual union all select
    '201005', '' from DUAL ;
    I want to go get these Order_ID who have Active Flg as NULL and do not have the entry for Active_Flg = Y

    If use the following, then it returns the distinct Order_ID but not the expected-
    SELECT DISTINCT ORDER_ID FROM T WHERE ACTIVE_FLG IS NULL;
    Result-
    ORDER_ID
    ------
    201004
    201002
    201003
    201005
    Kindly help...

    This?

    select order_id
      from (
              select order_id
                   , active_flg
                   , count(decode(active_flg, 'Y',1)) over(partition by order_id) cnt1
                   , count(decode(active_flg, null,1)) over(partition by order_id) cnt2
                from t
           )
     where cnt1 = 0 and cnt2 > 0;    
    
  • Query to select other records and then the same in 2 tables

    Dear all,

    My database is 10 gr 2 and OS is Linux.
    I have 2 tables with the same fields and almost the same data. There are just a few different lines in table 1 and table 2 that do not match each other.

    I need to select these non-matching rows in both tables in a single request.

    Kindly help on that.

    Best regards, Imran

    You have at LEAST two ways!

    (SELECT * FROM table_A
    minus
    SELECT * FROM table_B)
    union all
    (SELECT * FROM table_B
    minus
    SELECT * FROM table_A)
    /
    

    For example:

    SQL> create table table_a (col_1 number,  col_2 varchar2(5));
    
    Table created.
    
    SQL> create table table_b (col_1 number,  col_2 varchar2(5));
    
    Table created.
    
    SQL> insert into table_a values (1,'A');
    
    1 row created.
    
    SQL> insert into table_a values (2,'B');
    
    1 row created.
    
    SQL> insert into table_b values (1,'X');
    
    1 row created.
    
    SQL> insert into table_b values (2,'Z');
    
    1 row created.
    
    SQL> insert into table_a values (3,'C');
    
    1 row created.
    
    SQL> insert into table_b values (3,'C');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL>
    SQL> select * from table_a minus select * from table_b
      2  union all
      3  select * from table_b minus select * from table_a
      4  /
    
         COL_1 COL_2
    ---------- -----
             1 X
             2 Z
    
    SQL> (select * from table_a minus select * from table_b)
      2  union all
      3  (select * from table_b minus select * from table_a)
      4  /
    
         COL_1 COL_2
    ---------- -----
             1 A
             2 B
             1 X
             2 Z
    
    SQL>
    

    Hemant K Collette

  • SQL query to find the total number of source based nonsource passangersbetween source and destination station and passenger station on the same chekindate

    Hello

    SQL query to find the total number of source based nonsource passangersbetween source and destination station and passenger station on the same chekindate.

    Please help on this script and let me know if you need more details.

    ---

    You use a SELECT statement.  Let me know if you need more details.

  • Query to find records with more than 2 decimal places.

    I have written the below query to find records with more than 2 decimal places, but it is returning records with decimal places 1 & 2. 
    The datatype of the AMT column is NUMBER (without any precision).
    
    SELECT amt  FROM amount_table
     WHERE substr(amt, instr(amt, '.')) LIKE '.%'
           AND length(substr(amt, instr(amt, '.') + 1)) > 2
    Output:-

    AMT

    * 41591.1*
    * 275684.82*
    * 64491.59*
    * 3320.01*
    * 6273.68*
    * 27814.18*
    * 30326.79*
    131.8413635
    162.5352898
    208.5203816
    8863.314632
    22551.27856
    74.716992
    890.0158441
    2622.299682
    831.6683841
    * 1743.14*
    2328.195877
    3132.453438
    5159.827334
    3.236234727
    37.784
    Thanks

    Hello

    user1585440 wrote:

    when i inserted fee_amt as 41591.0999999999  it is displayed as 41591.1 in the output i.e,
    
    insert into amount_table (line_number,fee_amt) values (100,41591.0999999999);
    
    select fee_amt from amount_table  where line_number = 100. this query shows the output as below
    
    fee_amt
    
    41591.1
    
    The fee_amt column has number as datatype (without precision)
    
    Why it is automatically shown rounded off as 41591.1? 
    

    Published by: user1585440 on December 28, 2010 04:50

    You use SQL * more your front end?

    SQL * Plus has a fixed width to display all columns. The default for numbers is 10 characters. If necessary, SQL * Plus will be round a number or the use of scientific notation, to represent the number of the expected number of characters.
    You can use the SQL * more "SET NUMLARGEUR" to change the default view for all the numbers of orders, or "COLUMN" to set a sepcific format in an individual column.
    If you explicitly convert your channel numbers in a query, SQL * Plus adjusts the column width to whatever is needed. For example

    SELECT  TO_CHAR (fee_amt, 'TM')     AS fee_amt_d
    

    "TM" is the default format; You can call TO_CHAR with a single argument, if you prefer.

  • SQL query to retrieve a single record for each employee of the following table?

    Hi all

    Help me on the writing of SQL query to retrieve a single record for each employee of the following table? preferably a standard SQL.

    CREATE TABLE xxc_contact)

    empnum NUMBER,

    alternatecontact VARCHAR2 (100),

    relationship VARCHAR2 (10),

    phtype VARCHAR2 (10),

    Phone NUMBER

    );

    insert into xxc_contact values (123456, 'Rick Grimes', 'SP', 'Cell', 9999999999)

    insert into xxc_contact values (123456, 'Rick Grimes', 'SP', 'Work', 8888888888)

    insert into xxc_contact values (123457, 'Daryl Dixon', 'EN', 'Work', 7777777777)

    insert into xxc_contact values (123457, 'Daryl Dixon', 'EN', 'Home', 3333333333)

    insert into xxc_contact values (123456, 'Maggie Greene', 'CH', 'Cell', 9999999999)

    insert into xxc_contact values (123456, 'Maggie Greene', 'CH', 'Home', 9999999999)

    expected result:

    EmpNum AlternateContact Relationship PhType Phone       

    123456 rick Grimes SP cell 9999999999

    Daryl Dixon EN work 7777777777 123457

    Home 123458 Maggie Greene CH 6666666666

    Thanks in advance.

    994122 wrote:

    Thank you all, that I got a result

    http://www.orafaq.com/Forum/m/620305/#msg_620305

    By Lalit Kumar B...

    Specifically, the two simple solutions provided were:

    1 using the row_number, entitled Oracle ranking based on descending order of the inside telephone each empnum group. And finally selects the lines which has least rank (of least since that order is descending for phone).

    SQL > column alternatecontact format A20;

    SQL >

    SQL > SELECT empnum, alternatecontact, relationship, phtype, phone

    2 from (SELECT a.*, row_number() over r (PARTITION BY empnum ORDER BY phone / / DESC))

    3 FROM xxc_contact one)

    4. WHEN r = 1

    /

    EMPNUM ALTERNATECONTACT RELATIONSHIP PHTYPE PHONE

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

    123456 rick Grimes SP cell 9999999999

    Daryl Dixon EN work 7777777777 123457

    Home 123458 Maggie Greene CH 6666666666

    2. with the help of MAX, Oracle automatically assigns the maximum phone for all the rows in each group of empnum. And finally selects the rows with the maximum phone. Order by clause is omitted here intentionally. You can find out why.

    SQL > SELECT empnum, alternatecontact, relationship, phtype, phone

    2 (SELECT a.*, MAX (phone) over (PARTITION BY empnum) rn FROM xxc_contact one)

    3 WHERE phone = rn

    4.

    EMPNUM ALTERNATECONTACT RELATIONSHIP PHTYPE PHONE

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

    123456 rick Grimes SP cell 9999999999

    Daryl Dixon EN work 7777777777 123457

    Home 123458 Maggie Greene CH 6666666666

    Kind regards

    Lalit

  • create dynamically a group of record based on previously entered record Grou

    Forms [32 bit] Version 10.1.2.3.0 (Production)

    Hello
    I know how to create dynamically record based on a query and put the code in when a new instance of the form.
    My request is. I have a form that includes several groups of Record and the user wants to dynamically create the following groups based on the previous groups.

    For example
    I have a record group with choosing a location.
    When the user selects the location from a list of values
    the 2nd record group called "Cost Centres" will have to filter only those whose locations selected above.

    How can I fill the 2nd record running when I don't know what site the user will choose?
    If I just simply fill in when new instance of form as the location and just select the entire document, populates the list of values.

    CC field is a LIST ELEMENT and the style of list is a LIST of POP, is not necessary.

    I put the code in the location of the trigger when-list-changed field.
    I get this error:
    FRM-41337: cannot complete the record group list

    Here is the code:

    DECLARE
    
    v_recsql Varchar2(1000); -- The SQL for creating the Record Group.
    v_recgrp RecordGroup; -- Record Group
    v_status Number; -- Return Value of Populate_Group function.
    c_where VARCHAR2(1000);
    
    BEGIN
         IF :location = '1' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''02'')';
              
         ELSIF :location  = '2' THEN
              c_where := ' substr(cost_centre,1,2) in (''02'',''03'')';
              
         ELSIF :location   = '3' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''11'',''07'')';
                   ELSE
              c_where :=  ' 1=1'; --EVERYTHING
    
         END IF;
    
    v_recsql := 'SELECT cost_centre, description  FROM   cost_centres  where '||c_where;
    
    
    -- Create the Record Group
    v_recgrp := CREATE_GROUP_FROM_QUERY('v_recgrp', v_recsql);
    
    
    IF NOT ID_NULL(v_recgrp)
    THEN -- No Error, record group has been successfully created.
    
    
    -- Populate Record Group
    v_status := POPULATE_GROUP('v_recgrp');
    
    
    IF v_status = 0 
    THEN -- No Error. Record Group has been Populated. 
    POPULATE_LIST('block.CC', 'v_recgrp');
    END IF; -- IF v_status = 0 
    
    -- Delete the Record Group as it is no longer needed.
    DELETE_GROUP('v_recgrp'); 
    
    
    END IF; -- IF NOT ID_NULL(v_recgrp)
    
    END;
    Thanks for your help.

    Hello
    Once registration State Gets the change to block you cannot fill/repopulate the list item. Keep these list items as element non-base of data with different names and create different items such as database Moose points. That assign values in triggering WHEN-LIST-CHANGE for real database items.

    -Clément

  • Need to query to find missing months between two dates.

    A bank customer a monthly overview of databases (in the tens of millions of accounts)

    The data are sent with a line per account each month.  It is stored in a table called "ACCOUNTS_TAB".

    Fields on registration, which

    Column

    Description

    Example of format.

    * YRMTH-1

    Year and month of the snapshot

    6-character numeric, 4-digit year added to months of 2 digits, example 201301, 201311

    * AccountID

    Unique identifier for an account.

    Integer, example 100098322

    Opening balance - 1

    Initial account balance at the closing of the previous month

    $30000

    Closing balance - 1

    The account balance at the end of the month of closing

    $34200

    Class-1 relative to investments

    .....

    ...

    .....

    ......

    .....

    Many more columns, two favorites (*) columns are alone, that you will need for the query. There are no columns to tell when an account is closed, or has just opened, and not separate "master account" - you use this single table for your query that results.

    The table was in place from 200301, so many accounts have dozens of lines, if they have been open for many years and other only 1 or 2 ranks, if new.

    Write a query to give just a list of accountDs that meet the following criteria.

    1. 1) has a record for specific 201503
    2. 2) was also a record for the month specific 201602
    3. 3) missing one or several months between these two records.

    A good account which was opened from 201503 to 201602 inclusive would of course have lines for

    201503

    201504

    201505

    201506

    201507

    201508

    201509

    201510

    201511

    201512

    201601

    201602

    It's good to hardcode the month of departure (201503), end of month (201602) and the actual number of months between them (10 exclusive or 12 inclusive) as part of your query.

    Once again the account must meet all 3 criteria to be an account issue.  If only, they have a partial set of these documents but do not have the month of departure, or is not the end of the month, it is not a problem, only when they have so specified and end early and not a full between game.


    Help, please!

    Maybe this...

    -----

    -The Dataset for the test begins

    WITH dataset (ACCOUNT_NO, DATES)

    AS (SELECT 100, DOUBLE 201503

    UNION ALL

    SELECT 100, DOUBLE 201504

    UNION ALL

    SELECT 100, DOUBLE 201505

    UNION ALL

    SELECT 100, DOUBLE 201506

    UNION ALL

    SELECT 100, DOUBLE 201507

    UNION ALL

    SELECT 100, DOUBLE 201508

    UNION ALL

    SELECT 100, 201509 OF THE DOUBLE

    UNION ALL

    SELECT 100, DOUBLE 201510

    UNION ALL

    SELECT 100, 201511 OF THE DOUBLE

    UNION ALL

    SELECT 100, DOUBLE 201512

    UNION ALL

    SELECT 100, 201601 DOUBLE

    UNION ALL

    SELECT 100, DOUBLE 201602

    UNION ALL

    SELECT 200, DOUBLE 201503

    UNION ALL

    SELECT 200, DOUBLE 201504

    UNION ALL

    SELECT 200, DOUBLE 201505

    UNION ALL

    SELECT 200, DOUBLE 201506

    UNION ALL

    SELECT 200, DOUBLE 201508

    UNION ALL

    SELECT 200, DOUBLE 201509

    UNION ALL

    SELECT 200, DOUBLE 201510

    UNION ALL

    SELECT 200, DOUBLE 201511

    UNION ALL

    SELECT 200, DOUBLE 201512

    UNION ALL

    SELECT 200, 201601 DOUBLE

    UNION ALL

    SELECT 200, DOUBLE 201602

    UNION ALL

    SELECT 300, DOUBLE 201503

    UNION ALL

    SELECT 300, DOUBLE 201504

    UNION ALL

    SELECT 300, DOUBLE 201505

    UNION ALL

    SELECT 300, DOUBLE 201506

    UNION ALL

    SELECT 300, DOUBLE 201507

    UNION ALL

    SELECT 300, DOUBLE 201508

    UNION ALL

    SELECT 300, DOUBLE 201509

    UNION ALL

    SELECT 300, DOUBLE 201510

    UNION ALL

    SELECT 300, DOUBLE 201511

    UNION ALL

    SELECT 300, 201601 DOUBLE

    UNION ALL

    SELECT 300, DOUBLE 201602

    UNION ALL

    SELECT 400, DOUBLE 201504

    UNION ALL

    SELECT 400, DOUBLE 201505

    UNION ALL

    SELECT 400, DOUBLE 201506

    UNION ALL

    SELECT 400, DOUBLE 201507

    UNION ALL

    SELECT 400, 201508 DOUBLE),

    -The Dataset to test ends

    -Hand with clause begins

    ResultSet

    AS (SELECT account_no,

    CASE

    WHEN COUNT)

    CASE WHEN dates IN (201503, 201602) THEN 1 END)

    COURSES (PARTITION BY account_no) = 2

    AND (COUNT (DISTINCT SUBSTR (dates, 4)))

    COURSES (PARTITION BY account_no) = 12

    OR COUNT (DISTINCT SUBSTR (dates, 4))

    COURSES (PARTITION BY account_no)<>

    AND COUNT (DISTINCT SUBSTR (dates, 1, 4))

    (PARTITION BY account_no) > 1

    THEN

    « Y »

    ON THE OTHER

    « N »

    END

    FLG

    THE dataset---> replace with your table name

    GROUP BY account_no, dates)

    SELECT DISTINCT Account_no

    FROM THE result set

    WHERE flg = 'Y ';

    -Hand with the ends of the clause

    ACCOUNT_NO

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

    100

    300

    200

    See you soon,.

    Manik.

  • I can't find the recorded files recently in my document folder

    I can't find the recorded files recently in my document folder

    Maybe not save them there.

    Assuming that you have saved the today, go to the Finder, type 'Today' in the oval at top right.

  • I find these records long name with 20 or more charactors and inside them is nothing else than "mrt.exe" file. I find them in random places.

    Original title: MRT. EXE files are all over my computer.

    I find these records long name with 20 or more charactors and inside them is nothing else than "mrt.exe" file. I find them in random places on my drive c: and many of them on my external G drive in the root. A new appears approximately every three months.

    I know the mrt.exe is supposed to have something to do with the malicious software removal tool, so I don't want to just delete them and have a problem.

    Allen

    Hello

    Are you prevents the tool from running?

    See Q21 at the end of this article

    The Microsoft Windows malicious software removal tool helps remove specific and prevalent malicious
    software for computers running Windows 7, Windows Vista, Windows Server 2003, Windows
    Server 2008, or Windows XP
    http://support.Microsoft.com/kb/890830

    What you do not know the Windows Malicious Software Removal Tool
    http://blogs.Computerworld.com/what_you_dont_know_about_the_windows_malicious_software_removal_tool

    What is Windows Malicious Software Removal Tool (mrt.exe) and how to use it
    http://www.vista4beginners.com/Windows-malicious-software-removal-tool?page=1

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • Error on push notifications "cannot find any record of application settings.

    Hi im getting the error "Unable to find any record of application settings", with status 0 code. I hope someone can help me.

    private function addNotificationToHub():void
    {
    NotificationManager.notificationManager.addEventListener(ErrorEvent.ERROR, onNotificationError);
    NotificationManager.notificationManager.notifyNotification(notification);
    }
    
    private function onNotificationError(event:ErrorEvent):void
    {
    trace(event.errorID);
    }
    

    Thank you

    Javier

    I got it to notify the notification with the NotificationManager.notificationManager.notifyNotification () method, we need to display notification post_notification permission on bar - descriptor.xml authorisation to work.

    I found this error in google or here perhaps because almost everyone followed the tutorial on message notification.

    He also worked for me before, but the descriptorfile has been changed for some reason any and I do not notice it.

  • Find no records in an Excel sheet

    Hi all

    I am importing data from an excel file into oracle database. I wanted to know the number of records in an excel file and no columns using oracle webutil (Client_ole2). I received a web code that works very well, adding a NEM statement at the end of the file each time. Maybe it's not practical always, cannot ask user each time to add a statement of NEM, which in turn result in program to run infinitely.

    This is the code that is running

    DECLARE

    application Client_OLE2. Obj_Type;

    Client_OLE2 workbooks. Obj_Type;

    workbook Client_OLE2. Obj_Type;

    Client_OLE2 spreadsheets. Obj_Type;

    worksheet Client_OLE2. Obj_Type;

    worksheet2 Client_OLE2. Obj_Type;

    cell Client_OLE2. OBJ_TYPE;

    Client_OLE2 args. OBJ_TYPE;

    cell_value varchar2 (100);

    num_wrkshts NUMBER;

    wksht_name VARCHAR2 (250);

    EOD Boolean: = false;

    j integer: = 3;

    v_fName VARCHAR2 (250);

    worksheet_count number: = 0;

    BEGIN

    -Get the name of the file to open

    -v_fName: = "D:\MyDevelopment\Forms\Samples\WebUtil\Read_Excel\planets3.xls";

    v_fName: = WebUtil_File.File_Open_Dialog)

    directory_name = > "C:\". »

    -, file_name = > Get_Form_Property (:System.Current_form, Form_Name) |'. XLS

    , File_Filter = > null

    , Title = > 'Select customer filename to open.'

    );

    IF (v_fName IS NOT NULL) THEN

    -The following sets a communication with the excel worksheet

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

    -Open the OLE application

    application: = Client_OLE2.create_obj ('Excel.Application');

    -Keep the hidden application

    Client_OLE2.set_property (application, 'Visible ','false ');

    workbooks: = Client_OLE2. Get_Obj_Property (application "Filing cabinets");

    args: = Client_OLE2. CREATE_ARGLIST;

    -Open the selected file

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

    Client_OLE2.add_arg (args, v_fName);

    workbook: = Client_OLE2. GET_OBJ_PROPERTY (Workbooks, 'Open', args);

    Client_OLE2.destroy_arglist (args);

    worksheets: = Client_OLE2. GET_OBJ_PROPERTY (workbook, 'Worksheets');

    -Get the number of spreadsheets

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

    num_wrkshts: = Client_OLE2. GET_NUM_PROPERTY (worksheets, 'Count');

    worksheet: = Client_OLE2. GET_OBJ_PROPERTY (application, 'activesheet');

    -Go to the first record

    go_block ('EXCEL_EXPORT_TABLE');

    premier_enregistrement;

    loop

    If: system.record_status <>'NEW' then

    create_record;

    end if;

    When the exit NEM;

    for 1.15 k loop - 15 frames / record - hard-code the length of the column

    args: = Client_OLE2.create_arglist;

    Client_OLE2.add_arg (args, j);

    Client_OLE2.add_arg (args, k);

    cell: = Client_OLE2.get_obj_property (spreadsheet calculation, 'Cells', args);

    Client_OLE2.destroy_arglist (args);

    If Client_OLE2.get_char_property (cell, 'Value') = 'null' then

    cell_value: = ";

    on the other

    cell_value: = nvl (Client_OLE2.get_char_property (cell, 'Value'), 0);

    end if;

    If upper (cell_value) = 'NEM' then - the loop runs until "NEM" are judged.

    Nem: = true;

    Message ('end of data');

    "exit";

    end if;

    Copy (cell_value, name_in ('system.cursor_item'));

    next_item;


    end loop; -for

    j: = j + 1;

    end loop;-main loop

    premier_enregistrement;

    -Release the handles object Client_OLE2

    IF (cell IS NOT NULL) THEN

    Client_OLE2.release_obj (cell);

    END IF;

    IF (spreadsheet IS NOT NULL) THEN

    Client_OLE2.release_obj (Worksheet);

    END IF;

    IF (spreadsheets IS NOT NULL) THEN

    Client_OLE2.release_obj (Worksheets);

    END IF;

    IF (worksheet2 IS NOT NULL) THEN

    Client_OLE2.release_obj (worksheet2);

    END IF;

    IF (workbook IS NOT NULL) THEN

    Client_OLE2.release_obj (Workbook);

    END IF;

    IF (workbooks IS NOT NULL) THEN

    Client_OLE2.release_obj (Workbooks);

    END IF;

    Client_OLE2. Invoke (application, 'Quit');

    Client_OLE2.release_obj (application);

    ON THE OTHER

    Message ("no file selected.'");

    message(' ');

    RAISE Form_Trigger_Failure;

    END IF;

    END;

    Please think it has no integrated to find no records and columns in excel file using oracle forms.

    Thank you and best regards,

    JaKes

    This change according to excel data file.

    for example, we also use this logic. because the first column in excel file still does not empty. It should be full.

    If any column of a raw material can be empty, one with just my solution can be

    v_all_column_str: = col_A_Value | col_B_Value | col_C_Value | col_D_Value |... col_n_value;

    if v_all_column_str is null, then--> you can tell, all of the columns of this vintage in excellent file is empty

  • I just bought Adobe Acrobat Pro DC, and I can not find the 24-digit serial number. I can only find 2 codes to 19 different figures, but it will not accept them in the redemption of the student? Where can I find the codes?

    I just bought Adobe Acrobat Pro DC, and I can not find the 24-digit serial number. I can only find 2 codes to 19 different figures, but it will not accept them in the redemption of the student? Where can I find the code?

    Hi dobbynation,

    Please see this KB doc for help: redemption code help

    Let us know if you need help.

    Kind regards.

    Meenakshi

Maybe you are looking for