outer join does not give the expected results (missing documents)

Hello
I have problem with outer join in OBIEE 10 g.

I'm testing it on the model of simplified database

STAT table with some statistics of TYPEs
stat_date, id_type, num
..
..
26/03/2003, 20: 1
26/03/2003, 21: 1
26/03/2003, 23: 1
26/03/2003, 24, 1
26/03/2003, 25, 1
..
27/03/2003, 22, 1 <-different date here
..
..

Table TYPES
ID_type
..
..
20
21
22
23
24
25
..
..


Physical model
STAT >-TYPES


AM.
F1 (only Digital STAT table column (agg. County))
D1 (STAT_DATE of the STAT table column only)
D2 (source TYPES)

D1 - inner join - < F1
D2 - left outer join - < F1


I would like to create simple report filtered by date with number of each type.
I want to get this result
ID_type County
..     ..
..     ..
20 1
21 1
22 null
23 1
24 1
25 1
..     ..
..     ..


But I get this
ID_type County
..     ..
..     ..
20 1
21 1
23 1
24 1
25 1
..     ..
..     ..

ID_type 22 is missing


!!!

I NORMALLY GET RESULT ONLY IF I DELETE RECORD ' 27/03/2003 22' OF MY FACT TABLE.

!!!


I have the filter on the date column D1
STAT_DATE = 26/03/2003 or STAT_DATE is null


BI Server running this SQL query


Select distinct D1.c1 as c1,
D1. C2 C2
Of
(select count (T17840. NUM) in c1.
T17867.ID_TYPE C2
Of
Left outer join of TYPES T17867
STAT T17840 on T17840.ID_TYPE = T17867.ID_TYPE
where (T17840. STAT_DATE in (TO_DATE ('2003-03-26', 'YYYY-MM-DD')) or T17840. STAT_DATE is null)
T17867.ID_TYPE group
) D1


Can you give me some advice?

Thank you

Hi cardel,

I think that you can achieve your goal if you build a dimension of the array STAT form, you can create a table Alias in the physical layer and then to join the table of facts (external to the left). In this way, I think that you can solve your problem.

Let me know.

Kind regards
Gianluca

Tags: Business Intelligence

Similar Questions

  • % ROWCOUNT SQL does not return the expected result

    I have the following function within a package:

    --Update APPERY_JTI_deleted_USERS table:
    FUNCTION fn_updt_app_jti_dlt_usr(
        p_update_co      IN VARCHAR2,
        p_appery_user_id IN APPERY_JTI_deleted_USERS.appery_user_id%TYPE,
        p_outlet_code    IN APPERY_JTI_deleted_USERS.outlet_code%TYPE)
      RETURN NUMBER
    AS
    lv_sql       VARCHAR2(4000);
    lv_rowcount  NUMBER := 0;
    BEGIN
    
    lv_sql := 'UPDATE APPERY_JTI_deleted_USERS SET '||p_update_co||' = 1 WHERE '||p_update_co||' = 0 AND OUTLET_CODE = '''||p_outlet_code||''' AND APPERY_USER_ID = '''||p_appery_user_id||'''';
    
    --EXECUTE IMMEDIATE lv_sql;
    EXECUTE IMMEDIATE 'BEGIN ' || lv_sql || '; :z := sql%rowcount; END; ' USING OUT lv_rowcount ;
    
    RETURN lv_rowcount;
      
    EXCEPTION
    WHEN OTHERS THEN
      RETURN -1;  
    END fn_updt_app_jti_dlt_usr;
    
    

    The function called several times as part of a job. Basically, the main function (Say M), call a few functions (for example A1... A9). Each of these functions is to do something and updated the application using the above function. Therefore, each of the nine functions will call the above function with different parameters.

    The problem that I am facing is:

    First run, invoke only first of all for the above function will return the positive result ($sql rowcount > 0). When I run M the second time, only first and second calls for the above function will be to return positive results and so on.

    How odd, it's that if I change the values again and run a function M, it will start from the beginning. And what strange more, the dynamic update statement is executed correctly and data are updated successfully. It's just sql rowcount % do not return is not the expected results.

    I tried to run execute immediately without (begin, end). I also tried to run it without HELP ON. It's always the same. I'm really confused, what Miss me here.

    I don't know if this is relevant. But for what it's worth, invoking the function above updates the SAME lines in the table appery_jti_deleted_users that the columns are different. So for all the work, the same lines need to be updated. Each function (A1... A9) will call the above function to update a different column of these lines.

    If you REALLY want to help you having US SHOW, not tell us:

    1. WHAT you do

    2. HOW to

    3. WHAT results you get

    4. WHAT results you expect to get

    First run, invoke only first of all for the above function will return the positive result ($sql rowcount > 0). When I run M the second time, only first and second calls for the above function will be to return positive results and so on.

    How odd, it's that if I change the values again and run a function M, it will start from the beginning. And what strange more, the dynamic update statement is executed correctly and data are updated successfully. It's just sql rowcount % do not return is not the expected results.

    Perhaps that the foregoing is true and maybe he's not. We have NO WAY of knowing because you don't SHOW US anything.

    I tried to run execute immediately without (begin, end). I also tried to run it without HELP ON. It's always the same.

    Yet once you showed us NOTHING >

    You do NOT FOLLOW best practices when you use dynamic sql statements: the sql statement real so that you can print:

    1 SEE what's running - make sure there are no syntax errors, and it seems to be what you wanted

    2 EXECUTE/TEST manually - to see if he really runs without error and see what results it really give.

    3. FIX any syntax or other problems and retest it

    Instrument properly your code and you won't have the problems you are having.

    You should know by now what are the parameters are transmitted when you run the function. So, there are at least three sets of these parameters.

    So you should be able to:

    1 run the instrumented manually function three times

    2. see that all three SQL statements are

    3 manually run these instructions

    4. see that the number of lines is after each execution

    We have no idea of what the output of the function is every time you call it. Apparently, you have, if you save the results of the function somewhere, but you didn't post any of this info.

    We need real details to help you - just listen to your story is not enough.

  • Why is my zero-order hold to not give the expected result?

    I'm trying to reproduce the functionality of the function of the command discrete so that I can use it without having to have a ' loop control and Simulation ".» The attachment desiredresult.vi shows an example of the function to hold discreet order inside the ' loop control and Simulation ".» The other attachment (zeroorderholdquestion.vi) shows my attempt to achieve the same result. I multiplied all index of the loop of the sampling period for the index table for the output y resampled. I have this based on my understanding of the scheme of discrete command waiting given under http://zone.ni.com/reference/en-XX/help/371894G-01/lvsim/sim_dzoh/#details.

    However, I have difficulties to get the frequency of the wave before and after resampling to match to the top. (See attachment for more clarity on what I mean by that). Any suggestions on what I am doing wrong?

    Here, I wrote something similar perhaps to simulate a multi channel, mux, taste and will hold with crosstalk

    http://forums.NI.com/T5/LabVIEW/how-can-I-create-and-sample-and-hold-circuit-in-LabVIEW/m-p/2407256#...

    If time samplerate and hold have a clean report you just need help vi

    Another simple version:

  • Oracle text index does not return the expected results.

    Hello

    My project requires a generic search on 5 different columns and all the VARCHAR2 data type.
    As performance is very slow with AS % search, I try to use for the multi_column_datastore that is recommended for this.

    Here's what I did.

    1 - Create table.
    CREATE TABLE BILLING_SCHEMA.NAMES_TABLE ( 
        ID                  NUMBER(9,0) NOT NULL,
        ENTITY_NUMBER         VARCHAR2(30) NOT NULL,
        GIVEN_NAMES         VARCHAR2(50) NULL,
        SURNAME             VARCHAR2(30) NULL,
        ORGANISATION_NAME     VARCHAR2(60) NULL,
        DISPLAY_NAME        VARCHAR2(100) NULL 
        )
    /
    
     
    My search must be made on the columns ENTITY_NUMBER, GIVEN_NAMES, surname, ORGANISATION_NAME and DISPLAY_NAME.

    2. - insert values into the table
    INSERT INTO NAMES_TABLE VALUES(1, 'GH', NULL, NULL, NULL, 'GROUP OF HOSPITAL')
    /
    INSERT INTO NAMES_TABLE VALUES(2, 'DH', NULL, NULL, NULL, 'DEPARTMENT OF HEALTH')
    /
    INSERT INTO NAMES_TABLE VALUES(3, 'REC', NULL, NULL, NULL, 'DEBTOR FOR RECEIPTS')
    /
    INSERT INTO NAMES_TABLE VALUES(4, 'UN_REC', NULL, NULL, NULL, 'DEBTOR FOR UNMATCHED RECEIPTS')
    /
    INSERT INTO NAMES_TABLE VALUES(5, 'SAM_FUND', NULL, NULL, NULL, 'THE S FUND')
    /
    
     
    3 - create context multi_column_datastore index
    BEGIN
    CTX_DDL.CREATE_PREFERENCE('NAMES_TABLE_MULTI', 'MULTI_COLUMN_DATASTORE');
    CTX_DDL.SET_ATTRIBUTE('NAMES_TABLE_MULTI', 'COLUMNS', 'ENTITY_NUMBER, GIVEN_NAMES, SURNAME, ORGANISATION_NAME, DISPLAY_NAME');
    END;
    
    CREATE INDEX NAMES_TABLE_IDX
    ON NAMES_TABLE(ENTITY_NUMBER)
    INDEXTYPE IS   CTXSYS.CONTEXT
    PARAMETERS ('DATASTORE NAMES_TABLE_MULTI')
    
     
    4 - create the trigger that should update the column ENTITY_NUMBER if everything is inserted/updated
    CREATE OR REPLACE TRIGGER NAMES_TABLE_TRIGGER
    BEFORE INSERT OR UPDATE OF GIVEN_NAMES, SURNAME, ORGANISATION_NAME, DISPLAY_NAME  ON NAMES_TABLE
    FOR EACH ROW
    BEGIN
      :NEW.ENTITY_NUMBER := :NEW.ENTITY_NUMBER;
    END
     
    5. the search query
    SELECT *
    FROM NAMES_TABLE
    WHERE  CONTAINS(ENTITY_NUMBER,'%TH%') > 0
     
    I am so very confused here because the result returned is only
    ID     ENTITY_NUMBER     GIVEN_NAMES     SURNAME     ORGANISATION_NAME     DISPLAY_NAME         
     2      DH                  (null)        (null)         (null)          DEPARTMENT OF HEALTH 
     
    When I wait for him that the 5th inserted record is returned too as it contains "THE S FUND" that begins with "TH".

    When I use the search string '% %' and %, no results are returned, although I expect at least two records in each case.

    I would appreciate help with this.

    Thanks in advance,
    Marilyn

    Published by: user5615580 on 08/03/2011 21:35

    Published by: user5615580 on 08/04/2011 16:33
  • Request does not give the same result according to the computer

    Hi all

    My problem is very unclear to me, so I'll try to explain it the best I can...

    So I'm almost finished my project, and I want to try it on another computer.

    In my project, I generate a txt through several file datas, can I use this file to display graphical information on a graph. It works very well.

    So I made a kit of Distribution following this tutorial: http://www.howtocvi.net/2011/12/how-to-make-distribution-kit.html

    I installed the .exe on another computer, and I launched the program.

    My problem is that, for the same data, I used previously, the program is not the same behavior.

    My tracks on the chart do not look like they should be.

    I don't know what are the causes that both programs use the same algorithm...

    If you have an idea, I'll take it!

    Thanks for your answers,

    Kind regards

    Jerome.

    Well, the example was just stressing that debug and release can behave differently, I thought not that it could directly apply to your situation.

    If I were you, I'd start checking the inizialization of the variables, since it is one of the biggest differences between these two scenarios.

    After that, I will add a few DebugPrintf to print relevant during the life of the program variables: DebugPrintf output can be seen in the window Debug Output while developing the program and in utilities like DebugView when running the executable, so you can compare his production in two situations.

    Normally, after some trial and error clarifies the situation and the appropriate corrections can be made to the code.

  • Outer join does not

    Hello

    Pls help me my request. I tried the following, but it does not give the expected results.

    Tab1
    EmplId, RepDt, Code, Hrs
    1/100,1/2009,199,8
    1/100,1/2009,200,4
    1/100,1/2009,255,3
    200,1/1/2009,200,4
    100.5/1/2009,199,8


    Tab2
    EmplId, RepDt, Code, Hrs
    1/100,1/2009,200,6
    200,1/1/2009,200,3

    I need output like this - 4 rows - need of all the rows from TAB1 when EMPLID, REPDT match TAB2, field values: need at a time when Code is also, when emlid, correspondence of the date, the Code missing so need A hrs, display ZERO as Tab2 hours.

    1/100,1/2009,199,8,0 - did not exist is not in tab2, so hrs Tab2 is ZERO
    1/100,1/2009,200,4,6 - Emplid, RepDt, Code match existence in Tab2, Tab1 Hrs 8, 6 Hrs Tab2
    1/100,1/2009,255,3,0 - did not exist is not in Tab2, so Tab2 hrs is equal to ZERO
    200,1/1/2009,200,4,3 - Emplid, Repdt, Code Match existed in Tab2, 4 Hrs of Tab1, Tab2 3 Hrs

    We are in 10g, Oracle.

    I tried the following
    T1. EmplId = T2.emplid AND T1.repdt = T2.repdt AND T1.code, T2.code = (+) - returns the unique corresponding lines, 2 rows.

    Pls help.

    Thanks in advance.

    Published by: NL 23 February 2009 09:20

    Hello

    See the Boneist first message in this thread:

    select t1.emplid, t1.repdt, t1.code, t1.hrs, nvl(t2.hrs, 0)
    from   tab1 t1,
           tab2 t2
    where  t1.emplid = t2.emplid (+)
    and    t1.repdt = t2.repdt (+)
    and    t1.code = t2.code (+)
    and    (t1.emplid, t1.repdt) in (select emplid, repdt
                                     from   tab2)
    order by repdt, emplid, code;
    

    As Boneist said, this fact corresponds to option (b)
    "(b) do just an outer join, with a condition EXISTS (or IN) in the WHERE clause to find corresponding repdts.
    The

    (+)
    

    an outer join are signs.

  • Why "bgp bestpath missing-as-worst med" command does not produce the desired result?

    Can dear all, someone tell me why "bgp bestpath missing-as-worst med" command does not produce the desired result?
    And I use GNS3 to this practice, the IOS Version: 12.4 (3)
    TKS...

    Back to the beginning:
    192.168.23.0/24 192.168.12.0/24
    RA(F0/0)-(f0/0) RB (s2/0) - RC (s2/0)
    [AS1]                    [AS2]                    [AS3]

    Configuration:
    * RA *:
    A #do sh run (config - router). b r b
    router bgp 1
    no synchronization
    The log-neighbor BGP-changes
    1.1.1.0 netmask 255.255.255.0
    192.168.12.2 neighbor remote-2
    setmed map of nearby route 192.168.12.2 out
    No Auto-resume

    IP route 1.1.1.0 255.255.255.0 Null0

    setmed allowed 10 route map
    the metric value 20

    * RB *:
    B (config - router) #do sh run | b r b
    router bgp 2
    no synchronization
    BGP always-compare-med
    The log-neighbor BGP-changes
    BGP bestpath missing-as-worst med
    neighbor 192.168.12.1 distance-1
    neighbour 192.168.23.3 distance-3
    No Auto-resume

    * RC *:
    C (config - router) #do sh run | b r b
    router bgp 3
    no synchronization
    The log-neighbor BGP-changes
    1.1.1.0 netmask 255.255.255.0
    neighbour 192.168.23.2 distance-2
    No Auto-resume

    IP route 1.1.1.0 255.255.255.0 Null0

    But when I checked out table RB bgp, as below:

    B (config - router) #do sh ip bgp
    BGP table version is 2, local router ID is 192.168.23.2
    Status codes: deleted, cushioning d s, history of h, * valid, > best, i - internal.
    r SIDE-failure, stale S
    Source codes: i - IGP, e - EGP,? -incomplete
    Network Next Hop path metrics LocPrf weight
    * > 1.1.1.0/24 192.168.23.3 0 0 3 I
    *                          192.168.12.1            20                         0  1 i

    The prefix is assigned a MED of 0, but also the best path value when I use "bgp bestpath missing-as-worst med" in how to configure bgp... :-(

    Please take a look at the discussion on the configuration of drugs to an eBGP neighbor:

    https://supportforums.Cisco.com/thread/343397?TSTART=0

    Note that BGP MED is set to 0 even if the injected BGP route from a connected route.

    The first time I came across this problem sending MED was there in a picture of 5-6 years service provider. Routes were injected into BGP with the command 'network', has been validated by OSPF routes or static to null0. Involuntary consignment of drugs was mess with load balancing between 2 links of our inbound traffic from the same upstream service provider.

    Also note that if a route is learned via iBGP, border router removes MED before the road to advertising for an eBGP peers (i.e. the above comments apply a when a route is injected locally into the border and then router BGP sent to an eBGP peer).

    I don't know what the cause of the problem that you said in your last post. It delivers last for a long time or that it does not change after a while?

    p.s. Sorry, I edited post because I said "iBGP" instead of "eBGP" at some point.

  • GetDeviceCaps does not give the correct pixel factor in windows 7.

    GetDeviceCaps does not give the correct pixel factor in windows 7, if I use 96 dpi settings means it gives the pixel as 1 factor and if I user the 120 dpi settings means that he must give the factor 1.25 pixel, in windows xp, I had good factor with GetDeviceCaps but in window7, it returns 1 instead of 1.25 pixel factor can someone help me with this problem

    ScreenDPI.x = GetDeviceCaps (ScreenDC, LOGPIXELSX);
    float PixelX = (float) ScreenDPI.x/96;

    Hello

    I would like you to post your question in the TechNet forum.

    http://social.technet.Microsoft.com/forums/en-us/w7itproui/threads

    I hope this helps.

  • How can you save your illustration in Photoshop CC 2014 as PNG or JPEG file when it does not give the option?

    How can you save your illustration in Photoshop CC 2014 as PNG or JPEG file when it does not give the option?

    Thank you for your time and help in advance.

    Thanks for the reply. I have actually managed to do work. I had my work instead of 16 or 8-32 bit/channel value. Once I changed it to 16-bit/channel, he gave me the possibility to register under the registered name. Thanks again.

  • OCR does not give the option recognize Portuguese?

    OCR does not give the option recognize Portuguese

    How to solve the problem?

    This is for me:

  • Builder Viewer troubleshooting: title ID: account does not have the expected role of "application".

    Good afternoon

    Make my way through the initial round with DPS. Have a professional account, with mulitple Adobe ID, each creating content for their respective publications. When you try to build my first vewier custom, I received the following error message: title ID: account does not have the role of "application" expected.

    Screen shot 2011-11-14 at 4.47.10 PM.png

    I went into the accounts of my Adobe Master Account Administration tab.

    For applications and accounts Builder Viewer enabled this Adobe ID of the specific publication.

    account-admin.png


    However, the Viewer Builder error continues. Log Viewer generator. Log in to Viewer (with publication specifiction ID) generator. Same mistake. Return to Master Account Administration tab and I see the specific parameters and application generator Viewer for publication ID have not stuck.

    account-admin-after.png

    When I configure the user again, I see my name in the entry application is always there, but is no longer enabled.

    account-admin-after2.png

    Reactivate, shows up in the active list. Same result. Close the tab account Admin, Admin, account back to the tab is no longer enabled. Any ideas or advice on how to overcome the problems of application of this provision role account? Thank you!

    AM

    Hello

    Just got confirmation of the development team that this problem has been corrected and was deployed to production.

    You can open the administration of accounts and press the checkbox 'Activate' on behalf of the application. Now, it must be registered and working in the generator of spectator.

    With sincere friendships.

    KlaasJan Tukker

    Adobe Systems

  • Outer join does not not as expected left

    Hi all

    I have it here are three tables with values. Mentioned the under outer join query does not and behave like the inner query.

    CREATE TABLE RET_FUND_FEE

    (

    NPTF VARCHAR2 (8 CHAR),

    TPART VARCHAR2 (4 CHAR)

    );

    CREATE TABLE PART_PTF

    (

    Mf_Id VARCHAR2 (6 CHAR) NOT NULL,

    TPARTS VARCHAR2 (4 CHAR) NOT NULL

    );

    CREATE TABLE TFC_FUNDS

    (

    NPTF VARCHAR2 (8 CHAR) NOT NULL,

    MULTIFONDS_ID VARCHAR2 (6 CHAR)

    );

    INSERT INTO RET_FUND_FEE VALUES('111','A');

    INSERT INTO RET_FUND_FEE VALUES('111','D');

    INSERT INTO RET_FUND_FEE VALUES('111','E');

    INSERT INTO PART_PTF VALUES ('MF1', 'A');

    INSERT INTO PART_PTF VALUES ('MF1', 'B');

    INSERT INTO PART_PTF VALUES('MF1','C');

    INSERT INTO TFC_FUNDS VALUES('111','MF1');

    INSERT INTO TFC_FUNDS VALUES('111','MF1');

    INSERT INTO TFC_FUNDS VALUES('111','MF1');

    SELECT A.TPART, B.TPARTS, A.NPTF, B.Mf_Id, C.MULTIFONDS_ID, C.NPTF

    OF RET_FUND_FEE A, PART_PTF B, TFC_FUNDS C

    WHERE A.NPTF = C.NPTF

    AND C.MULTIFONDS_ID = B.Mf_Id

    AND A.TPART = B.TPARTS (+)

    AND C.MULTIFONDS_ID = 'MF1 '.

    AND C.NPTF = '111'

    Here, I expect all records in the RET_FUND_FEE table that I am using outer join.

    But I'm only corresponding chronogram RET_FUND_FEE, PART_PTF as an inner join. Can you get it someone please let me know what lack us.

    Is my version of oracle 11g

    SELECT

    A.TPART, B.TPARTS, A.NPTF, B.Mf_Id, C.MULTIFONDS_ID, C.NPTF

    Of

    PART_PTF B

    Join

    C TFC_FUNDS

    on (C.MULTIFONDS_ID = B.Mf_Id

    AND C.MULTIFONDS_ID = 'MF1 '.

    AND C.NPTF = '111'

    )

    right outer join

    RET_FUND_FEE HAS

    on (A.TPART = B.TPARTS

    and A.NPTF = C.NPTF) - added as correction

    TPART TPARTS NPTF MF_ID MULTIFONDS_ID NPTF
    A A 111 MF1 MF1 111
    A A 111 MF1 MF1 111
    A A 111 MF1 MF1 111
    E - 111 - - -
    D - 111 - - -

    or

    SELECT A.TPART, d.TPARTS, A.NPTF, d.Mf_Id, d.MULTIFONDS_ID, d.NPTF

    OF RET_FUND_FEE HAS

    , (

    Select

    *

    PART_PTF b, TFC_FUNDS C

    where B.Mf_Id = C.MULTIFONDS_ID

    AND C.MULTIFONDS_ID = 'MF1 '.

    AND C.NPTF = '111'

    ) d

    WHERE A.TPART = D.TPARTS (+)

    and A.NPTF = D.NPTF (+) - added as a correction

    Sorry had to correct the syntax oracle solution.

    The first one was bad because it would return also B lines that have no match in C.

    Sorry a correction more on these two approaches, missed the second predicate.

  • Left Outer Join does not work why?

    Hello

    I have a question I want to return all the id group grp_id table and count and give me a count of all "active" members in the Member table. There are a few members who are not active in the table of members who belong to groups in the grp_id table. I still want a record returned for these grpid, but since there is no active members for these groups, I would like a zero as the mbr_count. An active mbr is the one whose eff_dt is less than the date of the day and whose exp_dt is greater than today's date.

    I have listed the query below, which returns active records mbr, but unfortunately does not return a grpid (as in my example of data) is not an active member (grpid: has ""). I have also provided the DDL for both tables as well as some examples of data that gives me the (Incorrect) results, that I posted. I have also posted what I need (the 'Correct' results).

    Thanks for any help... (I use PL/SQL)

    THE QUERY I USE:
    =============
    SELECT
    G00.grpid,
    Count (M00.grpid) mbr_count
    Of
    g00 grp_id
    LEFT OUTER JOIN
    m00 MBR on
    G00.grpid = m00.grpid
    WHERE
    M00.eff_dt < sysdate
    AND
    M00.exp_dt > sysdate
    GROUP BY
    G00.grpid

    It gives me results like:

    INCORRECT RESULTS:
    ===============
    GRPID MBR_COUNT
    A 2
    B 2
    C 1

    I want to see is:

    CORRECT RESULTS
    ===============
    GRPID MBR_COUNT
    A 2
    B 2
    C 1
    D 0


    Here's the DOF and the sample data:

    create table grp_id (grpid varchar (1))

    insert into grp_id values ('A')
    insert into grp_id values ('B')
    insert into grp_id values ('C')
    insert into grp_id values (')

    Commit

    create table mbr (mbr_name varchar (10), varchar (1) grpid, eff_dt date, exp_dt date)

    insert into values of mbr ('BRAND', 'A', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('BRAND', 'A', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ('MARTY', 'A', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('MARTY', 'A', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ('FRANK', 'B', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('FRANK', 'B', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ('MARY', 'B', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('MARY', 'B', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ('JOHN', 'C', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '))
    insert into values of mbr ('JOHN', 'C', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY '))

    insert into values of mbr ("NOAM" 'd', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY ') ")

    Thanks for the script, shame on the missing semicolon :)

    Your date restrictions are implemented as "filter predicates" rather than "join predicates.
    that is the difference between a place ANDS extra o in the JOIN clause.

    SQL> SELECT
      2  g00.grpid,
      3  count(m00.grpid) mbr_count
      4  FROM
      5  grp_id g00
      6  LEFT OUTER JOIN
      7  mbr m00 on
      8  g00.grpid = m00.grpid
      9  WHERE
     10  m00.eff_dt < sysdate
     11  AND
     12  m00.exp_dt > sysdate
     13  GROUP BY
     14  g00.grpid
     15  /
    
    G  MBR_COUNT
    - ----------
    A          4
    B          4
    C          2
    
    SQL> SELECT
      2  g00.grpid,
      3  count(m00.grpid) mbr_count
      4  FROM
      5  grp_id g00
      6  LEFT OUTER JOIN
      7  mbr m00 on
      8  g00.grpid = m00.grpid
      9  AND
     10  m00.eff_dt < sysdate
     11  AND
     12  m00.exp_dt > sysdate
     13  GROUP BY
     14  g00.grpid;
    
    G  MBR_COUNT
    - ----------
    D          0
    A          4
    B          4
    C          2
    
    SQL> 
    
  • Want 4504: Hp Envy 4504 does not give the impression of color

    Hello

    My Hp Envy 4504 gives color impressions.

    Its keep giving only black & white or gray scale images.

    Also, I couldn't find the printing color profiles or presets under the printer settings.

    I only 'Black and White' and ' black and white - gray ' presets.

    What should I do to get the color print.

    I have two hp color and black ink cartridges installed.

    Help, please.

    Thank you

    Hi @sivak,

    Welcome to the Forums of HP Support!

    I understand that you are unable to print in color on your HP Envy 4504 printer. I will definitely do my best to help you.

    You are able to print a test highlighted report? The printer prints a blank Page or does not black print or ink color for the HP ENVY 4500 and Deskjet Ink Advantage 3540 e-all-in-One Printer Series.

    The problem only occurs when printing from Mac? It seems that there is a problem with the printer driver. Please see these instructions by my colleague Anti-double-U-di.

    Publish:

    10.10 yosemite, foot, make sure you have the latest updates, including Apple updates as well as updates from HP by Apple Software Update (ASU), currently HP printer software update Ver3.0

    Look for the updates (ASU) Apple
    1. click on the Apple in the left menu bar
    2. click on "about this Mac".
    3. click the button of "software updates... »
    4. make sure that the "Updates" icon is selected, click on 'Store' in the top menu
    5. click on 'reload the Page.
    6. install the HP updates (look for the last 'HP Printer Software Update"by the version number)

    Note: If you can't print or scan if he is an all-in-one HP printer, and then follow the steps below.

    Delete the print queue HP printer
    1. click on System Preferences
    2. click on printers & Scanners
    3. click on your printer HP to highlight, then click on the "-" symbol below to remove it from the queue
    4. click on the button "Delete printer" to confirm

    Add the HP printer in the print queue
    1. click on the symbol '+' at the bottom left
    2. If a drop down list with the printers menu appears, just click on "Add printer or Scanner..." »
    3 select your printer HP printer or series (depends USB/Ethernet/WLAN connection type, so choose your HP printer with the correct connection, IE Hello for printers single function and Hello to an MFP multifunction)
    4. after the lower filled, click on the drop down menu to "use:" and select your HP printer series
    5. click on the ' Add ' button.

    Try to print in coiour.

    If the steps above resolved your problem, you don't have to continue troubleshooting.  If you're still having problems, please continue to the next step.

    Before continues, the following steps will remove all printers to printers and Scanners, you may need your software and drivers for the printers to re - install if it is not part of the Apple software updates.

    Reset the printing system:
    1. open System Preferences
    2. open Printers and scanners
    3. on the left side where would be referred to as printers, right click and select "reset printing system...". »
    4. click on the "Reset" button when asked to confirm
    5. Enter your password, and then click OK (if prompted)
    6. Once completed, (notifications cannot pop up) you will simply see the Virgin 'printers & Scanners', just close

    Remove the software from HP/Hewlett-Packard:
    1. go on 'Finder '.
    2. go in "Applications".
    3. Locate and open the folder "Hewlett-Packard".
    4. If you see an "Uninstall HP program" listed here then run the uninstall program, otherwise, go to step 8
    5. click on the continue"" button.
    6. Enter your password, and then click OK (if prompted)
    7. When you are finished, click "exit".
    8 remove the HP folder or Hewlett-Packard (if still listed after uninstall) drag the folder to the trash
    9. right click on the Recycle Bin in the dock, click on "Empty" - and then confirm to empty the trash

    Repair disk permissions
    1. in the Finder, click Applications
    2. open the Utilities folder
    3. double-click on the disk utility
    4. on the left side, click on the hard drive which has Yosemite 10.10 installed to highlight
    5. click on the "repair disk permissions" nearly half lower the window (time may vary to finish)
    6. what repairs completed, a message near the bottom window 'Fix full permissions', now you can close the disk utility
    7. click on the Apple in the upper left corner, click "Restart" to restart your Mac

    Manually the drivers of HP printer install v3.0
    1. this link will take you to the apples for v3.0 HP printer drivers download
    2. click on the button 'Download' (remember where your download is if your downloads are not on the dock)
    3. open the "HPPrinterDrviers3.0.dmg".
    4. double-click on the "HewlettPackardPrinterDrivers.pkg".
    5. click on the continue"" button.
    6. After reading the license agreement, click the continue"" button.
    7. click on the button "I agree" If you agree
    8. click on the drive that Yosemite 10.10 is installed on and click on continue
    9. click on the 'Install' button (this will install the drivers for HP to your Mac)
    10. Enter your password, and then click the button 'Install Software' (if prompted)
    11. click on the "Close" button when the message "installation succeeded."

    Add a printer to print the queue
    1. open System Preferences
    2. open Printers and scanners
    3. click on the symbol ' + '.
    4. click on "Add a printer or a Scanner..." »
    5. click on "HP Envy printer 4504.
    6. click on the drop down menu to "use:" and choose "HP Envy 4504 Series."
    7. click on the ' Add ' button.

    Try to print in color.

    Please reply to this message with the result of your troubleshooting. I can't wait to hear strings attached good luck!

  • I have run this query to get the result as below, but, even if my query is running fine, that I do not get the expected result.

    I'm looking for only column compare to my same target table as a table source.

    My query:


    Select case when column_name_s is null and column_name_t is not null

    then "alter table GRADE_CONVERSION drop | column_name_t | ';'

    When column_name_s is not null and column_name_t is null

    then "alter table GRADE_CONVERSION add | column_name_s | ' ' || data_type_s | « ; »

    else 'alter table modify GRADE_CONVERSION | column_name_t | ' ' || data_type_t | « ; »

    alterations of the end

    from (select s.column_name column_name_s, t.column_name column_name_t,

    s.data_type data_type_s, t.data_type data_type_t

    (select column_name, column_id, data_type

    of all_tab_cols@database

    where owner = 'erhan.

    and table_name = "GRADE_CONVERSION."

    + 1

    full outer join

    (select column_name, column_id, data_type

    of all_tab_cols@database

    where owner = 'sarigul.

    and table_name = "GRADE_CONVERSION."

    + 6

    on s.column_name = t.column_name

    )




    Tables:



    Target table: table GRADE_CONVERSION in sarigul@database


    LETTER_GRADEVARCHAR2 (2)
    GRADE_POINTNUMBER (3.2)
    MAX_GRADENUMBER (3)
    MIN_GRADENUMBER (3)




    Table source: Table GRADE_CONVERSION in erhan@database

    LETTER_GRADEVARCHAR2 (2)
    GRADE_POINTNUMBER (3.2)
    MAX_GRADENUMBER (3)
    MIN_GRADENUMBER (3)
    CREATED_BYVARCHAR2 (30)
    CREATED_DATEDATE
    MODIFIED_BYVARCHAR2 (30)
    MODIFIED_DATEDATE



    want to see output that is similar to this * (please ignore the names of column here it's just a clear example :))


    ALTER table Target_table change BOOK_ID Varchar2 (4);

    ALTER table Target_table I addSBN_10 Varchar2(13), null;

    ALTER table drop TITLE Target_table;

    Erhan_toronto wrote:

    1.I used src.nullable src_nullable and tgt.nullable tgt_nullable but only show Yes as below: but want to see the result as not null or null

    ALTER table TEST_TARGET change the NUMBER of MAX_GRADE (3, 2) Yes

    Ok. So it's all about the Yes and the no decoding to Default Null or Not Null, isn't it?

    So, to test, change one of the table of sample for NOT NULL columns in the source table, and then run the following query:

    with src as
    (
      select src.table_name src_table_name, src.column_name src_col_name, src.data_type src_data_type, src.data_length src_data_len, src.data_precision src_data_precision, src.data_scale src_data_scale,
             src.nullable src_nullable
        from user_tab_columns src
       where table_name = 'TEST_SOURCE'
    ),
    tgt as
    (
      select tgt.table_name tgt_table_name, tgt.column_name tgt_col_name, tgt.data_type tgt_data_type, tgt.data_length tgt_data_len, tgt.data_precision tgt_data_precision, tgt.data_scale tgt_data_scale,
             tgt.nullable tgt_nullable
        from user_tab_columns tgt
       where table_name = 'TEST_TARGET'
    ),
    col_details as
    (
      select src.src_table_name, nvl(tgt.tgt_table_name, first_value(tgt_table_name) over(order by tgt_table_name nulls last)) tgt_table_name,
             src.src_col_name, src.src_data_type, src.src_data_len, src.src_data_precision, src.src_data_scale, src.src_nullable,
             tgt.tgt_col_name, tgt.tgt_data_type, tgt.tgt_data_len, tgt.tgt_data_precision, tgt.tgt_data_scale, tgt.tgt_nullable
        from src
        left outer join tgt
          on (
              src.src_col_name = tgt.tgt_col_name
             )
    )
    select *
      from (
            select case
                    when tgt_data_type != src_data_type or tgt_data_len != src_data_len or tgt_data_precision != src_data_precision or tgt_data_scale != src_data_scale or src_nullable != tgt_nullable
                      then 'alter table ' || tgt_table_name || ' modify ' || tgt_col_name || ' ' || src_data_type || ' (' ||
                      case when src_data_type in ('DATE') then null
                           else
                                case
                                  when src_data_type in ('VARCHAR', 'VARCHAR2')
                                    then nvl(to_char(src_data_len), ' ') || ') '
                                  else  decode(nvl(src_data_precision, -1), -1, null, nvl(to_char(src_data_precision), ' ') || ', ' || nvl(to_char(src_data_scale), ' ') || ')')
                                end
                      end
                      || decode(src_nullable, 'NO', ' NOT NULL', ' DEFAULT NULL')
                    when tgt_col_name is null
                      then 'alter table ' || tgt_table_name || ' add ' || src_col_name || ' ' || src_data_type ||
                      case when src_data_type in ('DATE') then null
                           else
                                case
                                  when src_data_type in ('VARCHAR', 'VARCHAR2')
                                    then nvl(to_char(src_data_len), ' ') || ') '
                                  else  decode(nvl(src_data_precision, -1), -1, null, nvl(to_char(src_data_precision), ' ') || ', ' || nvl(to_char(src_data_scale), ' ') || ')')
                                end
                      end
                      || decode(src_nullable, 'NO', ' NOT NULL', ' DEFAULT NULL')
                   end alter_statement
              from col_details
            )
    where alter_statement is not null;
    

    Erhan_toronto wrote:

    2. when I run below under user sarigul and erhan I get the result as OWNER, TABLE_NAME, COLUMN_NAME DATA_TYPE... I have a link between two users. They have access to two tables.

    • Select * from all_tab_columns

    where owner = 'erhan' and table_name = "TEST_SOURCE."

    • Select * from all_tab_columns

    where owner = 'sarigul' and table_name = "TEST_TARGET."

    Alright. This means that you both users are on the same database. Only change, you will have to do in the above query is so change user_tab_columns to all_tab_columns and add the OWNER predicate respectively with the clause.

Maybe you are looking for

  • Satellite A300D-1GN - slow down the start of Vista

    Hello... 2 days ago, I bought laptop Satellite A300D-1gn.I installed Vista Home and I have a problem with the boot at startup to be valuable. It's too long (about 2-3 min).My friend has a Toshiba lower than mine and there also a Vista home, but his p

  • I can't save my document in my external drive "my passport".

    I can't save my document in my external drive "my passport". This gives read-only access.

  • Key board and the @ button

    I just bought an Ideapad S10-2 at the Mexico have a Spanish keyboard @ is on the 'Q' key right of the botton How to make, "tested" this key and get the sign @ or what type of key combination should I use to get the symbol @ right now I use copy and p

  • Why are there several layers of folders 'Application Data'?

    Why does Windows 7 Professional x 64 creates structures of files like this: C:\Users\Settings\Application Data\Application Data\Application Data\Application Data\... and so on for several levels? For example, one of the user accounts on my computer h

  • Hello guys, I have problem to change color codes and need help!

    Hello, so basically I tried to change the color code by downloading this color.xml of the site How to change Adobe Dreamweaver Code view topic - Hongkiat.When you look at the site, the preview is also beautiful it may be, full of colors. And here is