Using Left Outer Join
Hi SAP,
I have an access database with table called "Employee_ID". I am linking this table to a table called "Sales" in our main database and trying to report on January 2009.
There is one employee that is not appearing in my report. I know this employee has had no sales in Jan 2009. So, I tried linking the table using Left Outer Join and still this employee is not appearing in my report.
As a test, when I bring in Employee_ID table alone, the missing employee appears but when I try linking it INNER or LEFT OUTER join to table Sales, this employee does not appear.
Any help how I can bring the employee in from table Employee_ID?
Many thanks in advance,
Zack H.
Carl & Raghavendra,
Your suggestion led me to the finding my solution. Your suggestion brought back the missing employee but I needed all employees that had sales in January 2009 AND those that didn't. So I had to tweak your select expert formula as follows:
isnull({Sales.amt}) or
{Sales.period}="0109"
This brought back everything as needed! There was one negative about using this method. The performance was poor. It took a really long time to run.
To avoid having to wait for this to run and increase the performance, I had to go into the database and add a $0.00 sales amt for employee 2040 (or an empty sales amount record) in the month of January 2009. This brought back everyone also and it obviously increased the performance exponentially. Curious, why does it take forever to run using the above formula in select expert?
Thank you both Raghavendra and Carl for your relentless efforts to find a solution. You did it!
Zack H.
Similar Messages
-
How to use left outer joins ,right outer joins and order by clause for belo
Hi,
How to use left outer joins ,right outer joins and order by clause for below XML query.
The query which is red colour returns null then its not displaying any values for columns in that tables. Tried decode, nvl function hasn't worked.
SELECT XMLAGG ( XMLELEMENT( "P", XMLFOREST( P.process_id AS Ppid,
(SELECT XMLAGG( XMLELEMENT( "PI", XMLFOREST( PI.question_id AS PIqid,
PI.process_id AS PIpid,
PI.innertext AS
PItext, PI.itemtype AS PItype,
PI.linkfrom AS PIfrom,
PI.linkto AS PIto,
PI.associated AS PIas,
PI.content_id AS PIc,
PI.exitpoint1_id AS PIe1,
PI.exitpoint2_id AS PIe2,
PI.exitpoint3_id AS PIe3,
PI.followoncall AS PIfoc,
PI.userinput AS PIui,
PI.resolveidentifier AS PIri,
PI.libquestion_idfk AS PIlqid,
PI.isLocked AS PIstls,
PI.PreviousAnswer AS PIPAns,
PI.VisibleToAgent AS PIVAgent,
PI.RetryAttempt AS PIRetry,
PI.Tags AS PITag,
SELECT XMLAGG( XMLELEMENT( "PO", XMLFOREST( PO.option_id AS POoid,
PO.question_id AS POqid,
PO.process_id AS popid,
PO.opt_innertext AS POtext,
PO.opt_linkfrom AS POfrom,
PO.opt_linkto AS POto,
PO.libquestion_idfk AS POlqid,
PO.liboption_idfk AS POloid ) ) )
FROM vw_liveProcessOption_Sim_v6 PO
WHERE PI.question_id = PO.question_id (+)
AND PI.process_id = PO.process_id (+)
) "A" ) ) ) AS "PO"
FROM vw_liveProcessItem_Sim_v6 PI
WHERE P.process_id = PI.process_id
) "A" ) ) ) AS "PI"
FROM liveProcess_ec P
WHERE (P.process_id = 450)
Any help really appreciated.
Thanksuser512743 wrote:
Hi,
Here below is the scripts of tables, insert statements and Required output.
CREATE TABLE VW_LIVEPROCESSOPTION_SIM_v6
( "OPTION_ID" NUMBER,
"QUESTION_ID" NUMBER(10,0),
"PROCESS_ID" NUMBER(10,0),
"OPT_INNERTEXT" VARCHAR2(200 CHAR),
"OPT_LINKFROM" VARCHAR2(20 CHAR),
"OPT_LINKTO" VARCHAR2(20 CHAR),
"LIBQUESTION_IDFK" NUMBER,
"LIBOPTION_IDFK" NUMBER
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,2,450,'Yes',null,'5',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,3,450,'Yes',null,'5',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,5,450,'Yes',null,'6',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,6,450,'Yes',null,'7',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,8,450,'Block All',null,'9',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,9,450,'Yes',null,'10',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,11,450,'Yes',null,'12',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,12,450,'Yes',null,'13',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,14,450,'Yes',null,'16',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,2,450,'No',null,'3',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,3,450,'No',null,'4',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,5,450,'No',null,'8',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,6,450,'No',null,'8',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,8,450,'Standard',null,'11',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,9,450,'No',null,'11',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,11,450,'No',null,'14',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,12,450,'No',null,'14',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,14,450,'No',null,'15',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (3,8,450,'Disabled',null,'12',null,null);
Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (4,8,450,'User Defined',null,'12',null,null);
REATE TABLE "VW_LIVEPROCESSITEM_SIM_v6"
( "QUESTION_ID" NUMBER(10,0),
"PROCESS_ID" NUMBER(10,0),
"INNERTEXT" VARCHAR2(200 CHAR),
"ITEMTYPE" VARCHAR2(50 CHAR),
"LINKFROM" VARCHAR2(500 CHAR),
"LINKTO" VARCHAR2(500 CHAR),
"ASSOCIATED" VARCHAR2(200 CHAR),
"CONTENT_ID" NUMBER,
"EXITPOINT1_ID" NUMBER(10,0),
"EXITPOINT2_ID" NUMBER(10,0),
"EXITPOINT3_ID" NUMBER(10,0),
"RESOLVEIDENTIFIER" VARCHAR2(40 CHAR),
"LIBQUESTION_IDFK" NUMBER(10,0),
"FOLLOWONCALL" NUMBER(1,0),
"USERINPUT" VARCHAR2(200 CHAR),
"ISLOCKED" NUMBER(1,0),
"PREVIOUSANSWER" NUMBER(1,0),
"VISIBLETOAGENT" NUMBER(1,0),
"RETRYATTEMPT" NUMBER(10,0),
"TAGS" VARCHAR2(50 BYTE)
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (1,450,'CBB1015 - Router Firewall Settinngs Process','Title',null,'2',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (2,450,'Is the customers PC Firewall turned off?','Question','1','2.2,2.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (3,450,'Advise the customer to turn off the PC Firewall in order to continue. Has this been done?','Question','2.2','3.2,3.1',null,278,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (4,450,'Advise the customer the PC Firewall must be switched off before this process????','ExitPoint','3.2',null,null,null,14,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (5,450,'Is the customer able to access the internet now?','Question','3.1,2.1','5.2,5.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (6,450,'Is the customer having a problem with a specific website?','Question','5.1','6.2,6.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (7,450,'1536: CBB1008 - Browser Setup and Daignostics','SubProcess','6.1',null,'1536-1-0',null,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (8,450,'What is the security level on the CPE Management page?','Question','6.2,5.2','8.4,8.3,8.2,8.1',null,279,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (9,450,'Change the security level to Standard. Does this resolve the customers issue?','Question','8.1','9.2,9.1',null,280,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (10,450,'Issue Resolved','ExitPoint','9.1',null,null,null,1,6,122,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (11,450,'Change the security level to Disabled. Is the customer able to browse the internet?','Question','9.2,8.2','11.2,11.1',null,281,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (12,450,'Change the security level to Standard. Is the customer able to browse the internet now?','Question','11.1,8.3,8.4','12.2,12.1',null,283,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (13,450,'Issue Resolved','ExitPoint','12.1',null,null,null,1,6,123,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (14,450,'Ask the customer to perform a master reset. Does this resolve their issue?','Question','12.2,11.2','14.2,14.1',null,282,null,null,null,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (15,450,'Faulty CPE','ExitPoint','14.2',null,null,null,1,6,124,null,null,null,null,null,null,null,null,null);
Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (16,450,'Issue Resolved','ExitPoint','14.1',null,null,null,1,6,123,null,null,null,null,null,null,null,null,null);
CREATE TABLE "LIVEPROCESS_EC_V"
( "PROCESS_ID" NUMBER(10,0),
"USER_ID" NUMBER(10,0),
"CREATED" TIMESTAMP (6)
Insert into LIVEPROCESS_EC (PROCESS_ID,USER_ID,CREATED) values (450,7460,to_timestamp('21-APR-08 09.34.41.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
Required O/P in XML format
<P>
<Ppid>450</Ppid>
<PI>
<PIqid>1</PIqid>
<PIpid>450</PIpid>
<PItext>CBB1015 - Router Firewall Settinngs Process</PItext>
<PItype>Title</PItype>
<PIto>2</PIto>
<PO />
</PI>
<PI>
<PIqid>2</PIqid>
<PIpid>450</PIpid>
<PItext>Is the customers PC Firewall turned off?</PItext>
<PItype>Question</PItype>
<PIfrom>1</PIfrom>
<PIto>2.2,2.1</PIto>
<PO>
<POoid>1</POoid>
<POqid>2</POqid>
<popid>450</popid>
<POtext>Yes</POtext>
<POto>5</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>2</POqid>
<popid>450</popid>
<POtext>No</POtext>
<POto>3</POto>
</PO>
</PI>
<PI>
<PIqid>3</PIqid>
<PIpid>450</PIpid>
<PItext>Advise the customer to turn off the PC Firewall in order to continue. Has this been done?</PItext>
<PItype>Question</PItype>
<PIfrom>2.2</PIfrom>
<PIto>3.2,3.1</PIto>
<PIc>278</PIc>
<PO>
<POoid>1</POoid>
<POqid>3</POqid>
<popid>450</popid>
<POtext>Yes</POtext>
<POto>5</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>3</POqid>
<popid>450</popid>
<POtext>No</POtext>
<POto>4</POto>
</PO>
</PI>
<PI>
<PIqid>4</PIqid>
<PIpid>450</PIpid>
<PItext>Advise the customer the PC Firewall must be switched off before this process????</PItext>
<PItype>ExitPoint</PItype>
<PIfrom>3.2</PIfrom>
<PIe1>14</PIe1>
<PO />
</PI>
<PI>
<PIqid>5</PIqid>
<PIpid>450</PIpid>
<PItext>Is the customer able to access the internet now?</PItext>
<PItype>Question</PItype>
<PIfrom>3.1,2.1</PIfrom>
<PIto>5.2,5.1</PIto>
<PO>
<POoid>1</POoid>
<POqid>5</POqid>
<popid>450</popid>
<POtext>Yes</POtext>
<POto>6</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>5</POqid>
<popid>450</popid>
<POtext>No</POtext>
<POto>8</POto>
</PO>
</PI>
<PI>
<PIqid>6</PIqid>
<PIpid>450</PIpid>
<PItext>Is the customer having a problem with a specific website?</PItext>
<PItype>Question</PItype>
<PIfrom>5.1</PIfrom>
<PIto>6.2,6.1</PIto>
<PO>
<POoid>1</POoid>
<POqid>6</POqid>
<popid>450</popid>
<POtext>Yes</POtext>
<POto>7</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>6</POqid>
<popid>450</popid>
<POtext>No</POtext>
<POto>8</POto>
</PO>
</PI>
<PI>
<PIqid>7</PIqid>
<PIpid>450</PIpid>
<PItext>1536: CBB1008 - Browser Setup and Daignostics</PItext>
<PItype>SubProcess</PItype>
<PIfrom>6.1</PIfrom>
<PIas>1536-1-0</PIas>
<PO />
</PI>
<PI>
<PIqid>8</PIqid>
<PIpid>450</PIpid>
<PItext>What is the security level on the CPE Management page?</PItext>
<PItype>Question</PItype>
<PIfrom>6.2,5.2</PIfrom>
<PIto>8.4,8.3,8.2,8.1</PIto>
<PIc>279</PIc>
<PO>
<POoid>1</POoid>
<POqid>8</POqid>
<popid>450</popid>
<POtext>Block All</POtext>
<POto>9</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>8</POqid>
<popid>450</popid>
<POtext>Standard</POtext>
<POto>11</POto>
</PO>
<PO>
<POoid>3</POoid>
<POqid>8</POqid>
<popid>450</popid>
<POtext>Disabled</POtext>
<POto>12</POto>
</PO>
<PO>
<POoid>4</POoid>
<POqid>8</POqid>
<popid>450</popid>
<POtext>User Defined</POtext>
<POto>12</POto>
</PO>
</PI>
<PI>
<PIqid>9</PIqid>
<PIpid>450</PIpid>
<PItext>Change the security level to Standard. Does this resolve the customers issue?</PItext>
<PItype>Question</PItype>
<PIfrom>8.1</PIfrom>
<PIto>9.2,9.1</PIto>
<PIc>280</PIc>
<PO>
<POoid>1</POoid>
<POqid>9</POqid>
<popid>450</popid>
<POtext>Yes</POtext>
<POto>10</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>9</POqid>
<popid>450</popid>
<POtext>No</POtext>
<POto>11</POto>
</PO>
</PI>
<PI>
<PIqid>10</PIqid>
<PIpid>450</PIpid>
<PItext>Issue Resolved</PItext>
<PItype>ExitPoint</PItype>
<PIfrom>9.1</PIfrom>
<PIe1>1</PIe1>
<PIe2>6</PIe2>
<PIe3>122</PIe3>
<PO />
</PI>
<PI>
<PIqid>11</PIqid>
<PIpid>450</PIpid>
<PItext>Change the security level to Disabled. Is the customer able to browse the internet?</PItext>
<PItype>Question</PItype>
<PIfrom>9.2,8.2</PIfrom>
<PIto>11.2,11.1</PIto>
<PIc>281</PIc>
<PO>
<POoid>1</POoid>
<POqid>11</POqid>
<popid>450</popid>
<POtext>Yes</POtext>
<POto>12</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>11</POqid>
<popid>450</popid>
<POtext>No</POtext>
<POto>14</POto>
</PO>
</PI>
<PI>
<PIqid>12</PIqid>
<PIpid>450</PIpid>
<PItext>Change the security level to Standard. Is the customer able to browse the internet now?</PItext>
<PItype>Question</PItype>
<PIfrom>11.1,8.3,8.4</PIfrom>
<PIto>12.2,12.1</PIto>
<PIc>283</PIc>
<PO>
<POoid>1</POoid>
<POqid>12</POqid>
<popid>450</popid>
<POtext>Yes</POtext>
<POto>13</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>12</POqid>
<popid>450</popid>
<POtext>No</POtext>
<POto>14</POto>
</PO>
</PI>
<PI>
<PIqid>13</PIqid>
<PIpid>450</PIpid>
<PItext>Issue Resolved</PItext>
<PItype>ExitPoint</PItype>
<PIfrom>12.1</PIfrom>
<PIe1>1</PIe1>
<PIe2>6</PIe2>
<PIe3>123</PIe3>
<PO />
</PI>
<PI>
<PIqid>14</PIqid>
<PIpid>450</PIpid>
<PItext>Ask the customer to perform a master reset. Does this resolve their issue?</PItext>
<PItype>Question</PItype>
<PIfrom>12.2,11.2</PIfrom>
<PIto>14.2,14.1</PIto>
<PIc>282</PIc>
<PO>
<POoid>1</POoid>
<POqid>14</POqid>
<popid>450</popid>
<POtext>Yes</POtext>
<POto>16</POto>
</PO>
<PO>
<POoid>2</POoid>
<POqid>14</POqid>
<popid>450</popid>
<POtext>No</POtext>
<POto>15</POto>
</PO>
</PI>
<PI>
<PIqid>15</PIqid>
<PIpid>450</PIpid>
<PItext>Faulty CPE</PItext>
<PItype>ExitPoint</PItype>
<PIfrom>14.2</PIfrom>
<PIe1>1</PIe1>
<PIe2>6</PIe2>
<PIe3>124</PIe3>
<PO />
</PI>
<PI>
<PIqid>16</PIqid>
<PIpid>450</PIpid>
<PItext>Issue Resolved</PItext>
<PItype>ExitPoint</PItype>
<PIfrom>14.1</PIfrom>
<PIe1>1</PIe1>
<PIe2>6</PIe2>
<PIe3>123</PIe3>
<PO />
</PI>
</P>
Thanks in advance
Edited by: user512743 on Nov 18, 2008 4:46 AM -
Multiple tables using left outer join?
Hi, guys:
I have 4 tables: A, B, C; if I want to do the following:
A left outer join B, its result left outer join C.
How can I do that? BTW, I am using DB2.
The following is a sample inner join:
select a.id, b.first, c.last
from A as a, B as b, C as c
thanksselect ..
from A a
left outer join B b ON ....
left outer join C c ON ...
WHERE ...
rgds -
SQL Select using LEFT OUTER JOIN returning field values when I expect NULL
I am having problems with this select statement:
SELECT distinct pl.id, th.trip, pc.country, pph.location
FROM people_list pl, people_travelhistory th, people_country pc
LEFT OUTER JOIN people_info pph on pph.id=pl.id and pph.country=pc.country
where people_list.active='Y' and people_list.id=th.id and th.trip = pc.trip;
The criteria is that the pph table may not have no record for that id and country.
The problem is that the pph.location field is returned with data even when no matching record for that id or country exists.
If the record doesn't exist in the pph table, I want pph.location = NULL
What am I doing wrong?
Thanks in Advance!
DeveloperHi, You can try this :
SELECT distinct pl.id, th.trip, pc.country, pph.location
FROM people_list pl, people_travelhistory th, people_country pc
left outer join people_info pph on pph.id = pl.id
left outer join people_country pc on pc.country = pph.country
left outer join people_travelhistory th on th.id = pl.id
where pl.active='Y' and th.trip = pc.trip;
Knowing that you requesting people active that have travelled to their own country.
Regards -
How to use left outer join on more than one table (source)
Hi all,
In our project we are converting the Unix shell & SQL scripts into OWB mappings. We are facing problem converting left outer join in OWB. here is one of the example. i have just pasted the FROM and where condition.
FROM ym_scr t1, branch_finmonth t3
LEFT OUTER JOIN item_image t2
ON (t1.branch_no = t2.branch_no
AND t1.item_no = t2.item_no
AND t3.to_date between t2.tran_dt and t2.to_dt
AND t2.to_dt >= '$start_images' ) <<<========= '$start_images' THIS COMES FROM THE UNIX VARAIBLE ,
We converts the same when we are putting it in OWB join Operator
INGRP1.branch_no = INGRP2.branch_no(+)
AND INGRP1.item_no = INGRP2.item_no(+)
AND INGRP3.to_date between t2.tran_dt and t2.to_dt
AND INGRP2.to_dt >= INGRP2.start_images
But as you see in the OWB opreator we can put left join with INGRP1 with INGRP2.
We can not make same join with INGRP3 & INGRP4 , becoz it failed saying "you cannot left outer join on more than one table/source".
so overall this OWB code makes incomplete left outer join as per the above ANSI SQL join in Oracle.
Bcoz of the problem we are getting less number of rows...........
SO please please help me on this
Regards
AshokHi.
I know this topic is here for a while now, but I had the same problem today, searched for help and didn´t find anything.
Later I figured out how to do this.
You just have to put the (+) one time, and the OWB converts in an LEFT OUTER JOIN statement.
For this case, all you have to do is:
( INGRP1.branch_no = INGRP2.branch_no(+) AND INGRP1.item_no = INGRP2.item_no AND INGRP2.to_dt >= INGRP2.start_images )
Regards,
Godoy -
Using Left Outer Join along with reference
I have three tables.
Table 1 : BOOK_DETAILS
Fields: BOOK_ID, BOOK_NAME
Table 2: BOOK_ISSUE_RECORD
Fields: BOOK_ID, USER_NAME
Table 3: BOOK_AUTHOR
Fields: BOOK_ID, AUTHOR_NAME
I have to link Table 1 and Table 2 with Left outer Join because even if the book is not issues to anyone, its name should come.
Again I have to display the Book Author name for each Book.
I am able to create a query with the Left outer join between Table 1 and Table 2. However I am not able to give a reference to the Table 3.
Can any one please help me with this.
Regards
Hawkerselect d.book_name,
a.book_author,
i.user_name
from book_details d
join
book_author a
on (d.book_id = a.book_id)
left join
book_issue_recors i
on (d.book_id = i.book_id)
/SY. -
How to use "left outer join" in SQVI
Dear ALL ,
I want to match MARA materials with BOM material table (MAST,STPO)material or Routing material table (MAPL,PLPO) and I want the list of NONMATCHING material codes from SQVI.
How to get these items which do not match in 2 tables........?
I have to work with SQVI + EXCEL ( VLOOKUP ) in excel sheet.
Thanks...Kishore,
After selecting the table join option, In layout mode enter the table names in Joined tables tab. Select the 2 tables using check boxex and select the join type like left inner and click on define condition. This would create a left inner join. Similarly carry out for the next 2 tables.
Hope it is useful. If so reward your points.
Regards
Ram -
Left outer join using multiple table
Hi,
I am trying to use left outer join with multiple tables , the join condition will be based on PERNR and BEGDA & ENDA for each infotype in selection screen.
select pa00~pernr pa00~begda pa00~endda pa00~massn pa00~massg pa00~stat2 pa00~aedtm pa00~uname
pa01~begda pa01~endda pa01~bukrs pa01~persg pa01~persk pa01~mstbr pa01~ename pa01~aedtm pa01~uname
pa02~begda pa02~endda pa02~nachn pa02~vorna pa02~midnm pa02~aedtm pa02~uname
pa016~begda pa016~endda pa016~cttyp pa016~aedtm pa016~uname
into CORRESPONDING FIELDS OF TABLE i_pall
from ( PA0000 as pa00 left OUTER JOIN pa0001 as pa01 on pa00~pernr = pa01~pernr )
left OUTER JOIN pa0002 as pa02 on pa00~pernr eq pa02~pernr )
left OUTER JOIN pa0016 as pa016 on pa00~pernr eq pa016~pernr )
where pa00~pernr in S_pernr
AND pa00~begda in s_bg0000
and pa00~endda in s_nd0000.
but this fails to fetch the value of begda enda from each pa0000,pa0001,pa0002,pa0016.
Please help!
MonirulWhy don't you use the standard logical database PNPCE and then Provide statement?
-
Left Outer Join not working in Infoset.
Hello Friends,
I have two ODSes , one for planned data (zplan) and other is billing z ods (zsd_o03).
now the situation is such that in my planned ODS for one sold to party .
SOLD TO MATERRIAL CALMONT PLANNED QUANTIY
14315 100 06.2007 54
14315 200 06.2007 20
14315 300 06.2007 30
14315 400 06.2007 10
But in my Billing ODS iam having for Sold to 14315
SOLD TO MATERRIAL CALMONT ACTUAL QUANTIY
14315 100 06.2007 20
14315 200 06.2007 30
And my Bex ouput should be like
SOLD TO MATERIAL CALMONT planned ACTUAL QUANTIY
14315 100 06.2007 54 20
14315 200 06.2007 20 30
14315 300 06.2007 30 0
14315 400 06.2007 10 0
So for this i made one Infoset and these ODses are linked by Sold_to , Materail,
Calmonth.
First i tried using Inner joing option , but the bottom two lines were not ciming , so used left outer join , and activated and recreated the query but still its showiong me the output same as inner join .. i.e
14315 100 06.2007 54 20
14315 200 06.2007 20 30
So i checked by writing a ABAP code in Se38 , but there its showing me the correct result ..
So please anybody help me out because iam thinking that infoset is the right way to do this kind of reporting , or esle shall i make one ODS and populate it through this ABAP code..
Thanks in advance.Hi , can anybody help me in this regard..
Thanks .. -
Left outer join usage in obiee BMM layer
Hi All,
We lately started using left outer join in our bmm layer , to meet the requirement expectation .
problem : We have two tables Fact A , Dim B . There is an join int_id column to join them . Problem is... in table Dim B , we have 3 millions rows of Int_id and in fact table it is loaded for only data available(1 million rows).
Due to this we are dropping rows in the report ..as it is only getting data where fact.int_id = dim.int_id. So we used left outer join to solve to one particular report .(we know we can do ETl to load dummy int_id and make it null , but it is huge effort ..so we did left outer join)
These days , same kind of reports are in requirement . if i keep on doing same left outer join to meet the requirement in BMM layer ? is there any disadvantages due to this ? any performance degrade due to this ? please throw few lines on left outer join and its usage ?
Thanks,
SriRemodel your tables that might be a partition or any other way and follow in BI as per your new model.
Simply: Go for ETL kind of solution -
How to do left outer join in one-one mapping
I tried to do a left outer join between two tables. I specified
kodo.jdbc.DBDictionary: JoinSyntax=sql92 in kodo.properties. I used
ref-join-type="outer" in the package.mapping. However, I still see Kodo is
translating my queries using inner join. How can I force kodo to use outer
join (or maybe even to use left outer join) when translating my queries?
Thanks.Kodo will automatically use an outer join when eager-fetching a to-one
relation (unless you have set null-value="exception" on the field, in
which case Kodo knows it can use an inner join). There is no need to set
the ref-join type (in fact, that is only for when the foreign key
columns are in a joined table).
When you place criteria on a relation in a query, though, the relation
must exist to satisfy the query. For example, in the filter:
"relation.x == y"
The "relation" field must hold a related object to satisfy the
expression, just as in Java.
If you want the "relation" field to optionally be null, then write your
filter exactly as you would in Java:
"relation == null || relation.x == y"
Kodo will correctly use an outer join in this case because the filter
can be satisfied even when no related object exists. -
I have tables with index on it , i join them using left outer join. So the table access path choosen by the optimizer is full table access.
index not used in it. is there any other way to use index ? alternate to left outer join to use index ?
thanks
RajHi
I have tables with index on it , i join them using left outer join. So the table access path choosen by the optimizer is full table access.
index not used in it. is there any other way to use index ? alternate to left outer join to use index ?There are several ways, for this problem
1. May be your tables does't have statistics..do analyse tables.
2. Joining conditions are wrong.
3. Check Filter conditions.
KPR -
Hi Experts,
I am facing a problem with left outer join query. Am using one standard table and ztable for this join. My problem is values are not extracted from the Ztable.
Query:
SELECT b~lifnr b~belnr b~gjahr b~xblnr b~shkzg b~blart b~zfbdt b~budat b~wrbtr
b~wskto b~zlspr s~EXTRACT_STATUS s~maturity_date FROM bsik AS b
LEFT OUTER JOIN zprm_rvne_sapdoc AS s
ON s~belnr EQ b~belnr
AND s~gjahr EQ b~gjahr
INTO CORRESPONDING FIELDS OF TABLE it_join
WHERE b~zlsch = p_zlsch
AND b~xblnr IN so_invno
ORDER BY b~lifnr b~xblnr.
I have all entries of BSIK table in Ztable with extract status as Y but this query is not fetching extract status and maturity date of ztable so it is blank in the internal table.
Need solution.
Regards
Sridevi SHi,
see the sample wiki for writing the Left outer join
http://wiki.sdn.sap.com/wiki/display/Snippets/EmployeeInfotype0000to9999ChangeHistory
Specifying Two or More Database Tables as a Left Outer Join
The left outer join, on the other hand, reads lines from the left-hand database table or join even if there is no corresponding line in the right-hand table.
SELECT...
FROM <tab> LEFT [OUTER] JOIN <dbtab> [AS <alias>] ON <cond>
<options>
<tab> and <dbtab> are subject to the same rules and conditions as in an inner join. The OUTER addition is optional. The tables are linked in the same way as the inner join with the one exception that all lines selected from <tab> are included in the final selection. If <dbtab> does not contain any lines that meet the condition <cond>, the system includes a single line in the selection whose columns from <dbtab> are filled with null values.
In the left outer join, more restrictions apply to the condition <cond> than in the inner join. In addition to the above restrictions:
EQ or = is the only permitted relational operator.
There must be at least one comparison between columns from <tab> and <dbtab>.
The WHERE clause may not contain any comparisons with columns from <dbtab>. All comparisons using columns from <dbtab> must appear in the condition <cond>.
If we have two tables named stud1,stud2 with the following data
Stud1: id Name stud2: id Name
1 xxx 1 aaa
2 yyy 2 bbb
3 zzz 4 ccc
4 www 6 ddd
When we use Left Outer Join we get the output as:
1 aaa
2 bbb
3 <Null>
4 ccc
When we use Right Outer Join we get the output as:
1 aaa
2 bbb
4 ccc
<Null> ddd
When we use Full Outer Join we get the output as:
1 aaa
2 bbb
3 <Null>
4 ccc
<Null> ddd
Prabhudas -
Error in making left outer join to a nested query
i am writing this query getting error here i am using nested query with that i am making join it is giving error
SQL
SELECT
* FROM IVItem INNER JOIN
IVPackSize_Mst ON IVItem.PackSizeID = IVPackSize_Mst.Id
left outer join IvItemGenericLink on IvItemGenericLink.itemID=IVItem.Id
Select GenericId from
IvItemGenericLink where ItemID=IVItem.Id and rownum <=1
)x
and x on IvItemGenericLink.GenericId=x.GenericId;
Error report:
SQL Error: ORA-00936: missing expression
00936. 00000 - "missing expression"
*Cause:
*Action:
give me and suggestioni am using left outer join at virtual table say x your gave me its equivalent
EXISTS (SELECT 1 FROM IvItemGenericLink G
WHERE G.ITEMID =V.ID
AND G.GenericId = L.GenericId)-----its i guess inner join
i am not confirmed that why iam asking this i guess i have to use this
as i use keyword inner join for inner join and for left join i use
left outer join
EXISTS (SELECT 1 FROM IvItemGenericLink G
WHERE G.ITEMID =V.ID
AND G.GenericId(+) = L.GenericId)-----its i guess left outer join
left outer join
Select GenericId from
IvItemGenericLink where ItemID=IVItem.Id and rownum <=1
)*x*
IvItemGenericLink.GenericId=x.GenericId
-------------------Statement U Gave in this--------------------------------------------------------------------------
SELECT *
FROM IVITEM V, IVPACKSIZE_MST M , IVITEMGENERICLINK L,
WHERE V.PACKSIZEID = M.ID
AND V.ID = L.ITEMID (+)
AND EXISTS (SELECT 1 FROM IvItemGenericLink G
WHERE G.ITEMID =V.ID
AND G.GenericId = L.GenericId)
-------------------Statement U Gave in this--------------------------------------------------------------------------
is this equivalent to left outer join
*AND EXISTS (
SELECT 1 FROM IvItemGenericLink G*
WHERE G.ITEMID =V.ID
*AND G.GenericId = L.GenericId
please tell me this in this regard -
Nested Left Outer Join : Data Set
Hi All
I am bit confused about data set used by Nested Left outer join.
Can anyone help me.
Here is sample data:
Tables (Name, 3 Column each, total rows and matched rows if any):
Table 1
A B C
Total 20 Rows
Table 2
A D E
Total 50 Rows and 10 Matching on 2.A = 1.A
Table 3
D M N
Total 15 Rows and 15 Matching on 3.D = 2.D
Table 4
M X Y
Total 20 Rows and 10 Matching on 4.M = 3.M
Sql
select *
From Table 1
Left Outer Join on Table 2 on
2.A = 1.A
-- Data set 1 will contain 20 Rows (10 matching and 10 non matching)
Left Outer Join on Table 3 on
3.D = 2.D
-- What will be data set? 20 Rows of Data set 1 or 15 Matching Rows?
Left Outer Join on Table 4 on
4.M = 3.M
-- What will be data set? X Rows of Data set 2 or 10 Matching Rows?
Please have a look and clear my understanding.SeshuGiri wrote:
I have two tables defined (below). Emp table has data and there is no data in Emp_Type table yet! Right now it is empty.
I want to write a query that returns data from both the tables even though there is no data in Emp_type table. I am using left outer join but it returning nothing. Anyone can help?
select *
from emp e
left outer join emp_Type t
on e.empid = t.empid
WHERE t.type_id = 1
and t.end_date is null;
The join is including all rows from emp, just like you want.
The WHERE clause is discarding all of those rows. Since all the columns from emp_type (alias t) are NULL, the condition "t.type_id = 1" in the WHERE clause is never true.
Perhaps you meant to include all those conditions in the join conditions, like this:
select *
from emp e
left outer join emp_Type t
on e.empid = t.empid
and t.type_id = 1
and t.end_date is null;Edited by: Frank Kulash on Jan 30, 2012 3:56 PM
Maybe you are looking for
-
UNLOCKING single row in ALV using Funtions
hai, Actually i am displaying a table in ALV USING FUNCTIONS and i am locking key values. Now my reqment is , if i press (NEW, COPY )button then i have to add one new row and that row should be Unlocked to insert values. Is it possible USING FUNCTION
-
How can I get my mail show up on notification area?
How can I get my mail show up in the notification area?
-
Work Center determination depending on vendor/supplier
Hi together, is there a possibility in SAP QM Standard to determine the workcenter for the resultrecording of specific Operation/Activity depending on the supplier? at the moment it's only possible for me to determine work center of the inspection op
-
Hi all, I have a problem when typing messages, i have a 16gb iphone that's got about 5gb free and i don't know whether that would have anything to do with it but it seems that when typing a text message its always really slow. even resetting the ipho
-
Problems authorizing computer on windows XP
I still use a windows XP pc and when I try to authorize the computer it says that another ID adobe which was never used to authorize another pc must be used. I thought I could authorize up to six pc with the same ID.