Query:  Not getting the desired result. Please help

QL> select * from ecev;
entity_Tag
7
8
9
10
1
2
3
4
5
6
SQL> select * from dg;
DIGP_TAG CEPT_TAG
600 1
700 1
800 1
900 1
100 1
200 1
500 1
75 2
SQL> select * from enow;
ENTITY_CODE ENTITY_TAG DIGP_TAG TARGET_DA CEPT_TAG
EXT 7           600      26-MAY-07 1
EXT 8           700      26-MAY-07 1
EXT 9           800      26-MAY-07 1
EXT 10           800      22-APR-76 1
EXT 1           100      20-OCT-06 1
EXT 2           200      20-OCT-06 1
EXT 3           500      20-OCT-06 1
EXT 4           100      20-OCT-06 1
EXT 5           100      20-OCT-06 1
EXT 6           80      20-OCT-06 1
EXT 1           75           2
SQL> select * from tk;
TK_TAG DIGP_TAG NARRATIVE DUE_DATE CEPT_TAG
35 90 raj 27-MAY-07               1
36 900 kkd 27-MAY-07               1
37 100 kim 28-MAY-07               1
30 100 ram 23-MAY-07               1
31 100 kish 23-MAY-07               1
32 200 mar 23-MAY-07               1
33 100 gy 23-MAY-07               1
34 100 mm 27-MAY-07               1
8 rows selected.
For the following query
1 select
2 d.ecev_tag ecev_tag,
3 a.digp_tag entity_owner ,
4 c.digp_tag task_owner,
5 c.tk_tag task_tag,
6 c.narrative
7 from enow a,
8 entl b,
9 tk c,
10 ecev d
11 where ( a.DIGP_TAG=100 or c.digp_tag=100)
12 and a.entity_tag=b.entity_tag(+)
13 and b.tk_tag=c.tk_tag(+)
14* and a.entity_tag=d.entity_tag
SQL> select * from entl;
TK_TAG ENTITY_TAG
35 5
36 10
30 1
31 1
32 2
33 3
34 3
Result:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG NARRATIVE
5 100 90 35 raj          row1
1 100 100 30 ram          row2
1 75 100 30 ram          row3 1 100 100 31 kish          row4
1 75 100 31 kish          row5 3 500 100 33 gy          row6
3 500 100 34 mm          row7
4 100                              row8
Row1: yes, since entity_tag 5 is owned by digp_tag 100 (enow)
Row2: yes, since entity_tag 1 is owned by digp_tag 100 (enow)
Row3: NO, since entity_tag 1 is owned by digp_tag 75, which in turn is in cept_tag 2, since the passed digp_tag is 100 and it just belongs to cept_tag 1 we should not be getting this row.
Row4: Yes, since tk_tag 31 is owned by digp_tag 100 (tk)
Row5 NO, since entity_tag 1 is owned by digp_tag 75, which in turn is in cept_tag 2 since the passed digp_tag is 100 and it just belongs to cept_tag 1 we should not be getting this row.
Row6: Yes, since tk_tag 33 is owned by digp_tag 100 (enow)
Row7: Yes, since tk_tag 34 is owned by digp_tag 100(enow)
Row8: Yes, since entity_tag 4 is owned by 100(enow
I guess i have to join dg.cept_tag and a.cept_tag, but it is not working.....
Can somebody understand this and help...
Thanks
Ram

QL> select * from ecev;
entity_Tag
7
8
9
0
1
2
3
4
5
6
SQL> select * from dg;
DIGP_TAG CEPT_TAG
600 1
700 1
800 1
900 1
100 1
200 1
500 1
75 2
SQL> select * from enow;
ENTITY_CODE ENTITY_TAG DIGP_TAG
TARGET_DA CEPT_TAG
EXT 7
          600      26-MAY-07 1
8           700
     26-MAY-07 1
EXT 9
          800      26-MAY-07 1
10           800
     22-APR-76 1
EXT 1
          100      20-OCT-06 1
2           200
     20-OCT-06 1
EXT 3
          500      20-OCT-06 1
4           100
     20-OCT-06 1
EXT 5
          100      20-OCT-06 1
6           80
     20-OCT-06 1
EXT 1
          75           2
L> select * from tk;
TK_TAG DIGP_TAG NARRATIVE DUE_DATE
CEPT_TAG
35 90 raj 27-MAY-07               1
36 900 kkd 27-MAY-07               1
37 100 kim 28-MAY-07               1
30 100 ram 23-MAY-07               1
31 100 kish 23-MAY-07               1
32 200 mar 23-MAY-07               1
33 100 gy 23-MAY-07               1
34 100 mm 27-MAY-07               1
8 rows selected.
For the following query
1 select
2 d.ecev_tag ecev_tag,
3 a.digp_tag entity_owner ,
4 c.digp_tag task_owner,
5 c.tk_tag task_tag,
6 c.narrative
7 from enow a,
8 entl b,
9 tk c,
10 ecev d
11 where ( a.DIGP_TAG=100 or c.digp_tag=100)
12 and a.entity_tag=b.entity_tag(+)
13 and b.tk_tag=c.tk_tag(+)
14* and a.entity_tag=d.entity_tag
SQL> select * from entl;
TK_TAG ENTITY_TAG
35 5
36 10
30 1
31 1
32 2
33 3
34 3
sult:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG
NARRATIVE
5 100 90
35 raj          row1
100 100 30
ram          row2
75 100
30 ram          row31 100 100
31 kish          row4
75 100
31 kish          row5
3 500 100
33 gy          row6
500 100 34
mm          row7
100                              row8
1: yes, since entity_tag 5 is owned by digp_tag 100
(enow)
Row2: yes, since entity_tag 1 is owned by digp_tag
100 (enow)
Row3: NO, since entity_tag 1 is owned by digp_tag 75,
which in turn is in cept_tag 2, since the passed
digp_tag is 100 and it just belongs to cept_tag 1 we
should not be getting this row.
Row4: Yes, since tk_tag 31 is owned by digp_tag 100
(tk)
Row5 NO, since entity_tag 1 is owned by digp_tag 75,
which in turn is in cept_tag 2 since the passed
digp_tag is 100 and it just belongs to cept_tag 1 we
should not be getting this row.
Row6: Yes, since tk_tag 33 is owned by digp_tag 100
(enow)
Row7: Yes, since tk_tag 34 is owned by digp_tag
100(enow)
Row8: Yes, since entity_tag 4 is owned by 100(enow
I guess i have to join dg.cept_tag and a.cept_tag,
but it is not working.....
Can somebody understand this and help...
Thanks
Ram
Result:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG NARRATIVE
5 100 90 35 raj     row1
1 100 100 30 ram     row2
1 75 100 30 ram     row3
1 100 100 31 kish     row4
1 75 100 31 kish     row5
3 500 100 33 gy     row6
3 500 100 34 mm     row7
4 100                    row8

Similar Messages

  • Function used in SQL query not showing the desired results

    I have created a function that gives me the client id but when i am using the function in the query its not giving me any result i.e. 0 rows but if I execute the function sepreatly and put the result of that function in the qurey it is giving me the desired result please have a look on the following and please reply with you expert opinion:
    FUNCTION CODE:
    create or replace function j2
    (usid in varchar2)
    return varchar2
    is
    cidn_in varchar2(4000) := '';
    ls_sep varchar2(1) := ',';
    cursor predicate_cidn
    is
    select
    logical_schema_id
    from
    CLIENT_REGISTRY cr,
    MEMBER_ROLE_CLIENT_ASSIGNMENT mrca,
    MEMBER m
    where
    mrca.base_client_id = cr.base_client_id and
    mrca.member_id = m.member_id and
    cr.schema_in_use_in = '1' and
    m.active_status_id = 'A' and
    upper(mrca.member_id) = upper(usid);
    BEGIN
    for GET_CIDN in predicate_cidn
    loop
    cidn_in := cidn_in || ls_sep || '''' || GET_CIDN.logical_schema_id || '''';
    end loop;
    cidn_in := substr(cidn_in, 2);
    cidn_in := '('||cidn_in||')';
    --dbms_output.put_line(cidn_in);
    return cidn_in;
    END ;
    SQL> select j2('qaa@adp') from dual;
    J2('QAA@ADP')
    ('BASE18','SDK1TEST','SEETHA1CONFIG','BASE09','KAREN2','SIVACONFIG','BASE19','SD
    K1CTEST','VASU1','KAREN5','EVENTS1CTEST','SDK1','ADA1CONFIG','BASE10','VRB1CONFI
    G','CRU2CONFIG','BASE20','SIVATEST','PCOMCONFIG','KP1CONFIG','KAREN4CONFIG','EVE
    NTS1TEST','SUZ3CONFIG','DONG2CONFIG','ED2CONFIG','SIVACTEST','APDCONFIG','EVENTS
    1CONFIG','ESSCONFIG','SIVA','SDK2CONFIG','ED3CONFIG','RAJ4CONFIG','CBRCONFIG','N
    AMRATA2CONFIG','EMIL1','NAMRATA1CONFIG','SDK2CTEST','BVT2CONFIG','MURUGAN1CONFIG
    ','COB1CONFIG','GABY1TEST','CHR1CONFIG','ED4CONFIG','USE1CONFIG','SDK2TEST','DEM
    O1CONFIG','BERNIE1CONFIG','XA1','CAR2TEST','SDK2','ED5CONFIG','PAY1TEST','PAYXCO
    NFIG','KP1TEST','SEAN1CONFIG','CAR2CTEST','VASU1CONFIG','SEAN2CONFIG','KP1CTEST'
    ,'MAU1CONFIG','CONWCONFIG','PAN1CONFIG','MERAJ2','PRA3CONFIG','SEAN5CONFIG','KP1
    ','PRA4CONFIG','CAR2CONFIG','PRA2CONFIG','SEAN6CONFIG','PRA3TEST','RPT','GABY1CT
    EST','SDK3CONFIG','PRA2TEST','SEAN9CONFIG','CAR2','LV1CONFIG','PRA3CTEST','DONG1
    CONFIG','TE1CONFIG','MERAJ2CONFIG','VIV1CONFIG','GABY1','SEAN2','PRA2CTEST','PRA
    3','RPTCONFIG','PRA4CTEST','SEAN3','MITA1CONFIG','PRA2','RPTCTEST','PCOM1CONFIG'
    ,'SS2CONFIG','PAY1CONFIG','SEAN7','ANNCONFIG','BASE11','BASE02','LV2CONFIG','RPT
    TEST','IMPECONFIG','SUR1CONFIG','SREEK2CONFIG','BASE03','SRINU3CONFIG','BDCONFIG
    ','JAY1CONFIG','AMMAN1','PRA1TEST','WPGCONFIG','BASE12','MP5CONFIG','MERAJ1','SR
    INU2CONFIG','XA1CONFIG','RAJ1CONFIG','WPGCTEST','BASE04','CHRIS','RAJSCONFIG','P
    ANKAJ','BASE13','WPGTEST','RAJ3CONFIG','WPG','BASE14','VASU2CONFIG','SRINU1CONFI
    G','BASE05','PRA4TEST','VASU1TEST','PRA5CONFIG','NISH1CONFIG','CHRISCONFIG','SDK
    3TEST','RAJ3TEST','KP2CONFIG','BASE06','DEFPCONFIG','NISH2CONFIG','CHRISCTEST','
    WPSCONFIG','VASU2TEST','BASE15','GABY1CONFIG','PRA5TEST','MITA2CONFIG','BASE07',
    'VASU1CTEST','KP2TEST','VASU2CTEST','LAURA3CONFIG','BASE16','CHRISTEST','WPSTEST
    ','VASU2','KP2CTEST','EVENTS1','BASE17','RAJ2CONFIG','WPSCTEST','BASE08','SREEK1
    CONFIG','ADVE','PRA4','SDK1CONFIG','KP2','KAREN1','CRU1CONFIG','WPS')
    Now if i put the results (cut and paste )in the query it gives me the results
    SQL> select count(*) from baseclient.address_detail where cidn in ('BASE18','SDK1TEST','SEETHA1CONFIG','BASE09','KAREN2','SIVACONFIG','BASE19','SD
    2 K1CTEST','VASU1','KAREN5','EVENTS1CTEST','SDK1','ADA1CONFIG','BASE10','VRB1CONFI
    3 G','CRU2CONFIG','BASE20','SIVATEST','PCOMCONFIG','KP1CONFIG','KAREN4CONFIG','EVE
    4 NTS1TEST','SUZ3CONFIG','DONG2CONFIG','ED2CONFIG','SIVACTEST','APDCONFIG','EVENTS
    5 1CONFIG','ESSCONFIG','SIVA','SDK2CONFIG','ED3CONFIG','RAJ4CONFIG','CBRCONFIG','N
    6 AMRATA2CONFIG','EMIL1','NAMRATA1CONFIG','SDK2CTEST','BVT2CONFIG','MURUGAN1CONFIG
    7 ','COB1CONFIG','GABY1TEST','CHR1CONFIG','ED4CONFIG','USE1CONFIG','SDK2TEST','DEM
    O1CONFIG','BERNIE1CONFIG','XA1','CAR2TEST','SDK2','ED5CONFIG','PAY1TEST','PAYXCO
    8 9 NFIG','KP1TEST','SEAN1CONFIG','CAR2CTEST','VASU1CONFIG','SEAN2CONFIG','KP1CTEST'
    10 ,'MAU1CONFIG','CONWCONFIG','PAN1CONFIG','MERAJ2','PRA3CONFIG','SEAN5CONFIG','KP1
    11 ','PRA4CONFIG','CAR2CONFIG','PRA2CONFIG','SEAN6CONFIG','PRA3TEST','RPT','GABY1CT
    12 EST','SDK3CONFIG','PRA2TEST','SEAN9CONFIG','CAR2','LV1CONFIG','PRA3CTEST','DONG1
    13 CONFIG','TE1CONFIG','MERAJ2CONFIG','VIV1CONFIG','GABY1','SEAN2','PRA2CTEST','PRA
    14 3','RPTCONFIG','PRA4CTEST','SEAN3','MITA1CONFIG','PRA2','RPTCTEST','PCOM1CONFIG'
    15 ,'SS2CONFIG','PAY1CONFIG','SEAN7','ANNCONFIG','BASE11','BASE02','LV2CONFIG','RPT
    16 TEST','IMPECONFIG','SUR1CONFIG','SREEK2CONFIG','BASE03','SRINU3CONFIG','BDCONFIG
    17 ','JAY1CONFIG','AMMAN1','PRA1TEST','WPGCONFIG','BASE12','MP5CONFIG','MERAJ1','SR
    18 INU2CONFIG','XA1CONFIG','RAJ1CONFIG','WPGCTEST','BASE04','CHRIS','RAJSCONFIG','P
    19 ANKAJ','BASE13','WPGTEST','RAJ3CONFIG','WPG','BASE14','VASU2CONFIG','SRINU1CONFI
    20 G','BASE05','PRA4TEST','VASU1TEST','PRA5CONFIG','NISH1CONFIG','CHRISCONFIG','SDK
    21 3TEST','RAJ3TEST','KP2CONFIG','BASE06','DEFPCONFIG','NISH2CONFIG','CHRISCTEST','
    22 WPSCONFIG','VASU2TEST','BASE15','GABY1CONFIG','PRA5TEST','MITA2CONFIG','BASE07',
    23 'VASU1CTEST','KP2TEST','VASU2CTEST','LAURA3CONFIG','BASE16','CHRISTEST','WPSTEST
    24 ','VASU2','KP2CTEST','EVENTS1','BASE17','RAJ2CONFIG','WPSCTEST','BASE08','SREEK1
    25 CONFIG','ADVE','PRA4','SDK1CONFIG','KP2','KAREN1','CRU1CONFIG','WPS');
    COUNT(*)
    228
    BUT if I user the function it gives me no results
    0 rows selected and its taking a loon time to reurn

    This appears to be a duplicate of the question in this thread
    Re: VPD issue Need Assistance ASAP
    where I wrote
    "Your function returns a single string that happens to have a bunch of commas and quotes in it. An IN list generally requires a list of strings, which your function doesn't return.
    You could rewrite the function to be a pipelined table function and then do
    select count(*)
    from baseclient.address_detail
    where cidn in (SELECT cidn
    FROM TABLE(<<your pipelined table function>>))
    However, I would expect it to be easier not to wrap all this into a function and just have your IN clause be the logic in your predicate_cidn cursor.
    Justin
    "

  • MDX Formula - Not Getting the Desired Results

    Hi All,
    I have the following formula that I am using to calculate the "Average Daily Volume MTD" but if I drilldown into the Products dimension then I don't see any values. It seems like it's only calculating the values at the top level (GEN1).
    CASE
    WHEN
    IsLevel ([Time Periods].CurrentMember, 0)
    THEN
    Sum(CrossJoin({[Trade Quantity]},{FirstChild(Parent([Time Periods].CurrentMember)):([Time Periods].CurrentMember)}))
    Sum(CrossJoin({[Trade Days Input]},{FirstChild(Parent([Time Periods].CurrentMember)):([Time Periods].CurrentMember)}))
    WHEN
    (IsLevel ([Time Periods].CurrentMember, 1))
    THEN
    [Trade Quantity] / ([Measures].[Trade Days Input])
    ELSE
    Missing
    END
    I tried to insert the another condition in the WHEN clause,
    AND IsAncestor([Products], [Products].Dimension.CurrentMember, INCLUDEMEMBER)
    but it still doesn't give me any values.
    Can anyone please help me out here?
    Thanks

    Hi Dighe,
    Thanks , I have tried that , but its not working.
    What is happening that , with every setting system is unable to filter batch .
    For each material it selects all the batches in query2 .
    If I try to jump from batch1 still it displays all the batches.
    If I use only the Batch in the assignment it dispalys all the rows of the query  so its evident that there is no filter applied at the batch level , I tried all the combination , single value , P , E , Infoobject etc. But it remains same.
    Any guess???
    Thanks.

  • SQL Query to get the desired result

    Can someone give the SQL to get this output.
    input is like this in table.
    cola     colb     fromdate     todate
    1     100     1/5/2010     1/9/2010
    1     101     1/10/2010     1/25/2010
    1     102     1/26/2010     12/31/2900
    2     201     3/1/2011     3/10/2011
    2     202     3/11/2011     12/31/2900
    3     301     1/5/2010     1/9/2010
    3     302     1/10/2010     1/25/2010
    3     303     1/26/2010     1/28/2010
    3     304     1/29/2010     12/31/2900
    I want to get the output like this.
    cola     colb     fromdate     todate
    1     100     1/5/2010     1/9/2010
    2     201     3/1/2011     3/10/2011
    3     301     1/5/2010     1/9/2010
    More info:
    I want to get the rows where fromdate is the min(fromdate) from each cola's unique values i.e. 1,2,3
    Please let me know the SQL.
    Thanks.
    [email protected]

    This way!!!
    with data(cola, colb, st_dt, ed_dt) as
    select 1,     100,     to_date('01/05/2010', 'MM/DD/YYYY'),     to_date('01/09/2010', 'MM/DD/YYYY') from dual union all
    select 1,     101,  to_date('01/10/2010', 'MM/DD/YYYY'),     to_date('01/25/2010', 'MM/DD/YYYY') from dual union all
    select 1,     102,     to_date('01/26/2010', 'MM/DD/YYYY'),     to_date('12/31/2900', 'MM/DD/YYYY') from dual union all
    select 2,     201,     to_date('03/01/2011', 'MM/DD/YYYY'),     to_date('03/10/2011', 'MM/DD/YYYY') from dual union all
    select 2,     202,     to_date('03/11/2011', 'MM/DD/YYYY'),     to_date('12/31/2900', 'MM/DD/YYYY') from dual union all
    select 3,     301,     to_date('01/05/2010', 'MM/DD/YYYY'),     to_date('01/09/2010', 'MM/DD/YYYY') from dual union all
    select 3,     302,     to_date('01/10/2010', 'MM/DD/YYYY'),     to_date('01/25/2010', 'MM/DD/YYYY') from dual union all
    select 3,     303,     to_date('01/26/2010', 'MM/DD/YYYY'),     to_date('01/28/2010', 'MM/DD/YYYY') from dual union all
    select 3,     304,     to_date('01/29/2010', 'MM/DD/YYYY'),     to_date('12/31/2900', 'MM/DD/YYYY') from dual
    select cola, colb, st_dt, ed_dt
      from (
            select cola, colb, st_dt, ed_dt,
                   row_number() over (partition by cola order by st_dt) rn
              from data
           ) a
    where a.rn = 1;
    COLA COLB ST_DT     ED_DT  
       1  100 05-JAN-10 09-JAN-10
       2  201 01-MAR-11 10-MAR-11
       3  301 05-JAN-10 09-JAN-10

  • Query to get the hierarchical results

    Hi,
    Please help me in writing a Query to get the hierarchical results. I want a result like follows...
    course-----groupname---TotalMembers---NotStarted---INProgress---Completed
    Course1---country1--------12---------------6----------3-------------3
    Course1-----state11-------12---------------6----------3-------------3
    Course1------District111--10---------------5----------0-------------0
    Course1--------City1111----0---------------0----------0-------------0
    Course1--------City1112----1---------------0----------0-------------1
    Course1--------City1113----6---------------3----------2-------------1
    Course1---country2--------12---------------6----------3-------------3
    Course1----state21--------12---------------6----------3-------------3
    Course1------District211--10---------------5----------0-------------0
    Course1--------City2111----0---------------0----------0-------------0
    Course1--------City2112----1---------------0----------0-------------1
    Course1--------City2113----6---------------3----------2-------------1
    Course2---country1--------12---------------6----------2-------------3
    Course2----state11--------12---------------6----------2-------------3
    Course2------District111--10---------------5----------0-------------0
    Course2--------City1111----0---------------0----------0-------------0
    Course2--------City1112----1---------------0----------0-------------1
    Course2--------City1113----6---------------3----------1-------------2
    Course2---country2--------12---------------6----------3-------------3
    Course2-----state21-------12---------------6----------3-------------3
    Course2------District211--10---------------5----------0-------------0
    Course2--------City2111----0---------------0----------0-------------0
    Course2--------City2112----1---------------0----------0-------------1
    Course2--------City2113----6---------------3----------2-------------1
    These are the Tables available to me.
    (I have just given some examle data in tables, to get the idea)
    "Groups" Table (This table gives the information of the group)
    GROUPID-----NAME-------PARENTID
    1---------Universe--------1
    2---------country1--------1
    3---------state11---------2
    4---------District111-----3
    5---------City1111--------4
    6---------City1112--------4
    7---------City1113--------4
    8---------country2--------1
    9---------state21---------8
    10--------District211-----9
    11--------City2111--------10
    12--------City2112--------10
    13--------City2113--------10
    "Users" Table (This table provides the user information)
    userID----FIRSTNAME---LASTNAME
    user1-----------Jim-------Carry
    user2-----------Tom-------lee
    user3-----------sunny-----boo
    user4-----------mary------mall
    "User-Group" Tables (This table provides the relation between the groups
    and the members)
    GROUPID---userID
    3-------------user1
    3-------------user2
    3-------------user4
    4-------------user5
    5-------------user6
    5-------------user7
    user_score (This table provides the user scores of different courses)
    USERID----course-----STATUS
    user1------course1-----complete
    user1------course2-----NotStarted
    user2------course1-----NotStarted
    user2------course2-----complete
    user3------course1-----complete
    user3------course2-----InProgress
    user4------course2-----complete
    user4------course1-----NotStarted
    I will explain the first four lines of the above result.
    Course1---country1--------12---------------6----------4-------------2
    Course1-----state11-------12---------------6----------4-------------2
    Course1------District111--10---------------5----------3-------------2
    Course1--------City1111----0---------------0----------0-------------0
    Course1--------City1112----1---------------0----------0-------------1
    Course1--------City1113----6---------------3----------2-------------1
    # "city1111" group has 0 members
    # "city1112" group has 1 member (1 member completed the course1)
    # "city1113" group has 6 members(3 members notStarted,2 members
    InProgress,1 member completed the course1)
    # "District111" is the parent group of above three groups, and has 3
    members.(2 members NotStarted,1 member InProgress the course1). But this
    group has child groups, so the scores of this group has to rollup the
    child groups scores also. Thats why it has 2+3+0+0=6 members Not
    Started,1+2+0+0=3 members InProgress,0+0+1+1=2 members completed.
    # "state11" group also same as the above group.
    I am able to get the group hierarchy by using "Connect By" like follows
    "select name,groupid,parentid from groups_info start with groupid=1 connect by parentid = prior groupid;"
    But i want to get the result as i have mentioned in the begining of this discussion.
    I am using oracle 8i (oracle8.1.7).
    Thank you for any help
    Srinivas M

    This may not be exactly what you want,
    but it should be fairly close:
    SET      LINESIZE 100
    SET      PAGESIZE 24
    COLUMN   groupname FORMAT A20
    SELECT   INITCAP (user_score.course) "course",
             groupnames.name "groupname",
             COUNT (*) "TotalMembers",
             SUM (NVL (DECODE (UPPER (user_score.status), 'NOTSTARTED', 1), 0)) "NotStarted",
             SUM (NVL (DECODE (UPPER (user_score.status), 'INPROGRESS', 1), 0)) "InProgress",
             SUM (NVL (DECODE (UPPER (user_score.status), 'COMPLETE', 1), 0)) "Completed"
    FROM     user_score,
             user_group,
             (SELECT ROWNUM rn,
                     name,
                     groupid
              FROM   (SELECT     LPAD (' ', 2 * LEVEL - 2) || name AS name,
                                 groupid
                      FROM       groups
                      START WITH groupid = 1
                      CONNECT BY PRIOR groupid = parentid)) groupnames
    WHERE    user_score.userid = user_group.userid
    AND      user_group.groupid IN
             (SELECT     groupid
              FROM       groups
              START WITH groupid = groupnames.groupid
              CONNECT BY PRIOR groupid = parentid)
    GROUP BY user_score.course, groupnames.name, groupnames.rn
    ORDER BY user_score.course, groupnames.rn
    I entered the minimal test data that you
    provided and a bit more and got this result
    (It was formatted as you requested,
    but I don't know if it will display properly
    on this post, or wrap around):
    course  groupname            TotalMembers NotStarted InProgress  Completed
    Course1 Universe                        6          2          0          4
    Course1   country1                      5          2          0          3
    Course1     state11                     5          2          0          3
    Course1       District111               2          0          0          2
    Course1         City1112                1          0          0          1
    Course1         City1113                1          0          0          1
    Course1   country2                      1          0          0          1
    Course1     state21                     1          0          0          1
    Course1       District211               1          0          0          1
    Course1         City2113                1          0          0          1
    Course2 Universe                        5          1          1          3
    Course2   country1                      4          1          1          2
    Course2     state11                     4          1          1          2
    Course2       District111               1          0          1          0
    Course2         City1113                1          0          1          0
    Course2   country2                      1          0          0          1
    Course2     state21                     1          0          0          1
    Course2       District211               1          0          0          1
    Course2         City2113                1          0          0          1
    Here is the test data that I used, in case
    anyone else wants to play with it:
    create table groups
      (groupid  number,
       name     varchar2(15),
       parentid number)
    insert into groups
    values (1,'Universe',null)
    insert into groups
    values (2,'country1',1)
    insert into groups
    values (3,'state11',2)
    insert into groups
    values (4,'District111',3)
    insert into groups
    values (5,'City1111',4)
    insert into groups
    values (6,'City1112',4)
    insert into groups
    values (7,'City1113',4)
    insert into groups
    values (8,'country2',1)
    insert into groups
    values (9,'state21',8)
    insert into groups
    values (10,'District211',9)
    insert into groups
    values (11,'City2111',10)
    insert into groups
    values (12,'City2112',10)
    insert into groups
    values (13,'City2113',10)
    create table user_group
      (groupid number,
       userid  varchar2(5))
    insert into user_group
    values (3,'user1')
    insert into user_group
    values (3,'user2')
    insert into user_group
    values (3,'user4')
    insert into user_group
    values (4,'user5')
    insert into user_group
    values (5,'user6')
    insert into user_group
    values (5,'user7')
    insert into user_group
    values (7,'user8')
    insert into user_group
    values (13,'user9')
    insert into user_group
    values (11,'use11')
    insert into user_group
    values (6,'use6')
    create table user_score
      (userid varchar2(5),
       course varchar2(7),
       status varchar2(10))
    insert into user_score
    values ('use6','course1','complete')
    insert into user_score
    values ('user9','course1','complete')
    insert into user_score
    values ('user9','course2','complete')
    insert into user_score
    values ('user8','course1','complete')
    insert into user_score
    values ('user8','course2','InProgress')
    insert into user_score
    values ('user1','course1','complete')
    insert into user_score
    values ('user1','course2','NotStarted')
    insert into user_score
    values ('user2','course1','NotStarted')
    insert into user_score
    values ('user2','course2','complete')
    insert into user_score
    values ('user3','course1','complete')
    insert into user_score
    values ('user3','course2','InProgress')
    insert into user_score
    values ('user4','course2','complete')
    insert into user_score
    values ('user4','course1','NotStarted')

  • My photoshop element 10 stop working,  I am not able to open ti anymore.  ?  I posted this question a few days ago and I did not get any anwer yer,  please help

    My photoshop element 10 stop working,  I am not able to open ti anymore.  ?  I posted this question a few days ago and I did not get any anwer yer,  please help

    I have photoshop premiere element 10  editor and organizer    and I have a Macbook pro 10,9,9
    When I try to open a picture with element editor or if I try to open PS editor directly  I see this
    file:///Users/main/Desktop/Screen%20Shot%202014-11-26%20at%201.17.35%20PM.png
    when I click on   Modify    it doesn't open and I have this window
    file:///Users/main/Desktop/Screen%20Shot%202014-11-26%20at%201.21.07%20PM.png
    and if I click  REOPEN  , I still have the same message
    Lucie

  • My new iPhone 5 has black and white lines on the screen. It's not been damaged. I've tried turning it off but this does not solve the problem? Please help.

    My new iPhone 5 has black and white lines on the screen. It's not been damaged. I've tried turning it off but this does not solve the problem? Please help. I can't find my answer on the Internet.

    By far the most common problem hardware-wise seems to be scuffs on the aluminium. Yours is the first report of a faulty screen I've seen.
    If you use the same Apple ID on both devices it'll sync whatever you want it to - music/apps/photos/messages/etc.
    I've just switched from a Galaxy S3 to iPhone 5 (having already owned an iPad for a while) so I'm in a similar position!

  • I have the 10.7.4 and I cannot get the Flash Player ,, please help me.

    I have the 10.7.4 and I cannot get the Flash Player ,, please help me.

    If you downloaded it, it's likely in your Downloads folder as a Disk Image .dmg. Just open it and intall Flash player and restart your browser. Everything should work.
    Clinton

  • HT201442 I did this but still i am getting the same error , please help me .

    I did this but still i am getting the same error , please help me .
    <Email Edited by Host>

    Look at http://support.apple.com/kb/ts4451
     Cheers, Tom

  • HELLO, I UNLOCKED MY 3GS PHONE THEN RESTORED  IT TO FACTORY DEFAULTS THROUGH ITUNES THEN COULD NOT REACTIVATE THE IPHONE, I TRIED SEVERAL TIMES USING WIFI AND ITUNES, IT CAN NOT DETECT THE SIM, SOMEONE PLEASE HELP ME WITH FOLLOW UP, THANKS

    HELLO, I UNLOCKED MY 3GS PHONE THEN RESTORED  IT TO FACTORY DEFAULTS THROUGH ITUNES THEN COULD NOT REACTIVATE THE IPHONE, I TRIED SEVERAL TIMES USING WIFI AND ITUNES, IT CAN NOT DETECT THE SIM, SOMEONE PLEASE HELP ME WITH FOLLOW UP, THANKS

    sir as ur reply i guess that my phone has locked again as i restored to factory defaults, now if i try with a att active sim then can i activate the iphone ? and i think  i need to unlock again if i want to use sim other then att right ? pls reply me in details asap

  • HT201304 ello my little brother has developed lock my iPhone and I could not see the unlocking code Please help and thank you

    Hello
    ello my little brother has developed lock my iPhone and I could not see the unlocking code Please help and thank you
    edited by host

    Hi Omar_a983,
    If you are having an issue with the passcode on your iPhone, you may find the following article helpful:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    Regards,
    - Brenden

  • HT204022 I backed my old iphone up to my computer and bought a new iphone.  When i backed my new phone up I now I have an icloud photo (from my computer) album that I want to delete from my phone but I do not have the option.  Please help.

    I backed my old iphone up to my computer and bought a new iphone.  When i backed my new phone up I now I have an icloud photo (from my computer) album that I want to delete from my phone but I do not have the option.  Please help.

    If the album was synced to your phone from your computer, it can only be removed by sycing it off.  To do this, deselect the folder on the Photos tab of your iTunes sync settings and sync.

  • Progression not yielding the desired result

    Hi
    I have written a text query using the progressive relaxation method. It is not giving me the desired results. Here are the query details:
    I have created an Intermedia index on a table with following specs:
    BEGIN
    CTX_DDL.DROP_PREFERENCE('CTXSYS.COMPANY_SEARCH_MULTI');
         CTX_DDL.CREATE_PREFERENCE('CTXSYS.COMPANY_SEARCH_MULTI', 'MULTI_COLUMN_DATASTORE');
         CTX_DDL.SET_ATTRIBUTE(     'CTXSYS.COMPANY_SEARCH_MULTI',
                        'columns',
                        'COMPANY,
                        DESC_N_PRODS,
                        PROD_DESC_N_PRODS,
                        PG_TITLE_GLUSR,
                        PG_KWD_DESC,
                        GEOGRAPHICAL_PROFILE,
                        GLUSR_DESC,
                        SUBCAT_DESC,
                        CTL_DESC,
                        SHORT_PROFILE,
                        LONG_PROFILE');
         CTX_DDL.DROP_SECTION_GROUP('CTXSYS.COMPANY_SEARCH_GROUP');
         CTX_DDL.CREATE_SECTION_GROUP('CTXSYS.COMPANY_SEARCH_GROUP', 'BASIC_SECTION_GROUP');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F1',     'COMPANY');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F2',     'DESC_N_PRODS');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F3',     'PROD_DESC_N_PRODS');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F4',     'PG_TITLE_GLUSR');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F5',     'PG_KWD_DESC');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F6',     'GEOGRAPHICAL_PROFILE');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F7',     'GLUSR_DESC');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F8',     'SUBCAT_DESC');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F9',     'CTL_DESC');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F10','SHORT_PROFILE');
         CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F11','LONG_PROFILE');
         CTX_DDL.DROP_PREFERENCE('CTXSYS.IIL_LEXER');
         CTX_DDL.CREATE_PREFERENCE('CTXSYS.IIL_LEXER','BASIC_LEXER');
    CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_LEXER', 'INDEX_STEMS', 'ENGLISH');
         CTX_DDL.DROP_PREFERENCE('CTXSYS.IIL_FUZZY_PREF');
         CTX_DDL.CREATE_PREFERENCE('CTXSYS.IIL_FUZZY_PREF', 'BASIC_WORDLIST');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','FUZZY_MATCH','ENGLISH');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','FUZZY_SCORE','60');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','FUZZY_NUMRESULTS','100');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','SUBSTRING_INDEX','TRUE');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','PREFIX_INDEX','TRUE');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','PREFIX_MIN_LENGTH','1');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','PREFIX_MAX_LENGTH','3');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','WILDCARD_MAXTERMS','15000');
         CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','STEMMER','ENGLISH');
    END;
    CREATE INDEX COMPANY_SEARCH_IM on COMPANY_SEARCH(DUMMY) INDEXTYPE IS
    CTXSYS.CONTEXT PARAMETERS
    ('DATASTORE CTXSYS.COMPANY_SEARCH_MULTI SECTION GROUP CTXSYS.COMPANY_SEARCH_GROUP MEMORY 50M
    LEXER CTXSYS.IIL_LEXER WORDLIST CTXSYS.IIL_FUZZY_PREF STOPLIST CTXSYS.IIL_STOPLIST');
    Now if I want to search for a string - acrylic crochet
    My progressive clause is as follows:
    <QUERY>
    <TEXTQUERY>
    <PROGRESSION>
    <SEQ>(acrylic crochet) within F2</SEQ>
    <SEQ>($acrylic $crochet) within F2</SEQ>
    <SEQ>(acrylic crochet) within F3</SEQ>
    <SEQ>($acrylic $crochet) within F3</SEQ>
    <SEQ>(NEAR((acrylic,crochet))) within F2</SEQ>
    </PROGRESSION>
    </TEXTQUERY>
    </QUERY>
    The data set has a record where F2 Contains following text:
    Manufacturers and exporters of yarns like acrylic yarn, viscose yarns, acrylic blended yarn, acrylic knitting yarn, spun yarn, blended yarns, braided thread, chenille yarn, cotton yarn, crochet yarn, dupion silk yarns etc
    My problem is that - This record is not coming in the search result.
    The record starts appearing if I use only NEAR Clause. as shown below:
    <QUERY>
    <TEXTQUERY>
    <PROGRESSION>
    <SEQ>(NEAR((acrylic,crochet))) within F2</SEQ>
    </PROGRESSION>
    </TEXTQUERY>
    </QUERY>
    Please advise what could be wrong - is my Index proper, or my progressive clause has some problem or there is something else which I have totally missed.
    Regards
    Madhup

    The discussion in the link below contains the same bug that you have encoutered and some workarounds.
    Re: progressive relaxation doesn't progress

  • Even though block popup windows is unchecked in content tab of options, I am still not getting any popups. Please help me.

    Hi - Even though block popup windows is unchecked in content tab of options, I am still not getting any popups. Please suggest how to over come this problem.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Did you make sure that your security software isn't blocking the pop-ups?
    Boot the computer in Windows Safe Mode with network support (press F8 on the boot screen) as a test.
    *http://www.bleepingcomputer.com/tutorials/how-to-start-windows-in-safe-mode/

  • I have a compilation problem with my mini iPod that is preventing my volume from increasing. I can't get the compilation code, please help me

    MY mini iPod version number1.1.3 pc robs iPod ,4GB is having volume limit problem ,the volume is very low compare to how it was playing before I mistakenly touch the combination code. I have forgotten the combination code, please help me out.. I have tried to reset settings but it wouldn't work.

    i can get the combination code please

Maybe you are looking for