How to join three queries in sap bw

Hi,
I have to create one report as combination of three reports.
This report will be combination of three Report
ZQ_Ap_005 -- ZCFIAPCO
ZQ_AR_008 u20130FIAR_003
ZQ_AP_016u2014ZCFIAPPU
This condition I have to join
Company Code (005 & 016) = Trading Partner (from ZQ_AR_008)
Vendor (ZQ_AP_005 & 016) = Company code (from ZQ_AR_008)
I can not use infoset because using 3.5 version. And in 3.5 can not include infocube in infoset.
Any suggestion.

Hi Namah
you need not do any java scripting for this. The command is enough to take care of your situation.
Perhaps an example can help you. Suppose you have Query1,  Query2 & Query3 and Button1 and Button 2. Button 3
For Query1, through the item properties, set Visiblility=Visible, for Query2, set Visibility=Hidden.
Query3, set Visibility=Hidden.
This will take care of your initial situation.
Now, take button1, assign the command 'Set webitem properties'. In the command settings, set item binding=query1, and then in the next page of command settings set visibility=hidden. Now, click the button -Next COmmand-> Insert -assign the command 'set webitem properties' once again. Here, select the item binding as query2, then in the command settings, set visibilty=visible. What you have done now is assigning 2 commands to the same button, both getting trigerred with a single click.
Now, this command setting will take care of making query1 hidden and query 2 visible.
Similarly, do the settings for the button 2, with query1=visible and query2=hidden.
Now, the result will be that on clicking button1 and button2, you can toggle between your queries.
Hope this helps..

Similar Messages

  • How to join THREE different tables into internal table using one select statement .

    How to join THREE different tables into internal table using one select statement .
    Hi experts,
    I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
    Scenario:
    Database tables:
    SPFLI
    SFLIGHT
    SBOOK.
    Table Fields:
    SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
    SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
    SEATSOCC_C SEATSMAX_F SEATSOCC_F
    SBOOK - CARRID CONNID CLASS
    MY INTERNAL TABLE IS IT_XX.
    Your help much appreciated.
    Thanks in advance.
    Pawan.

    Hi Pawan,
    please check below codes. hope it can help you.
    TYPES: BEGIN OF ty_xx,
            carrid     TYPE spfli-carrid   ,
            connid     TYPE spfli-connid   ,
            countryfr  TYPE spfli-countryfr,
            cityfrom   TYPE spfli-cityfrom  ,
            countryto  TYPE spfli-countryto,
            cityto     TYPE spfli-cityto   ,
            fldate     TYPE sflight-fldate ,
            seatsmax   TYPE sflight-seatsmax ,
            seatsocc   TYPE sflight-seatsocc ,
            seatsmax_b TYPE sflight-seatsmax_b,
            seatsocc_b TYPE sflight-seatsocc_b,
            seatsmax_f TYPE sflight-seatsmax_f,
            seatsocc_f TYPE sflight-seatsocc_f,
            class      TYPE sbook-class,
          END OF ty_xx,
          t_xx TYPE STANDARD TABLE OF ty_xx.
    DATA: it_xx TYPE t_xx.
    SELECT spfli~carrid
           spfli~connid
           spfli~countryfr
           spfli~cityfrom
           spfli~countryto
           spfli~cityto
           sflight~fldate
           sflight~seatsmax
           sflight~seatsocc
           sflight~seatsmax_b
           sflight~seatsocc_b
           sflight~seatsmax_f
           sflight~seatsocc_f
           sbook~class
      INTO TABLE it_xx
      FROM spfli INNER JOIN sflight
      ON spfli~carrid = sflight~carrid
      AND spfli~connid = sflight~connid
      INNER JOIN sbook
      ON spfli~carrid = sbook~carrid
      AND spfli~connid = sbook~connid.
    Thanks,
    Yawa

  • How to join three tables and practical difference between 10g and 11g

    I want to know with example how to outer join three different tables in Oracle.
    Also if you have any website or reference for understand syntax or performance difference between 10g and 11g then please paste a link in.thanks!!

    Hi,
    897293 wrote:
    I want to know with example how to outer join three different tables in Oracle.The 3rd table comes into the result set the same way the 2nd one did:
    FROM           table_1  t1
    LEFT OUTER JOIN      table_2  t2  ON   ...
    LEFT OUTER JOIN      table_3  t3  ON   ...The join condition(s) for t3 can reference t1, or t2, or both.
    Also if you have any website or reference for understand syntax or performance difference between 10g and 11g then please paste a link in.thanks!!The main manuals all have "What's New" sections near the beginning. For example:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/wnsql.htm#sthref5
    Hoek,
    We've missed you. Welcome back!

  • How to join three tables?

    I have used this query to join three tables but it displays an error : field vbak-vbeln is unknown.
    please help me out..
    SELECT vbak-vbeln vbak-bstnk vbap-matnr vbap-zmeng makt-maktx
    INTO CORRESPONDING FIELDs OF TABLE itab FROM vbak
    inner JOIN vbap ON vbak-vbeln eq vbap-vbeln
    inner JOIN makt ON vbap-matnr eq makt-matnr
    WHERE vbak-bstnk = s_bstnk.

    Hi mohan kumar ,
    just follow the Syntax
    SELECT FLD1 FLD2 FLD3 FLD4 FLD5 INTO CORRESPONDING FIELDS OF TABLE ITAB FROM TABLE1 INNER JOIN TABLE2 ON
    TABLE1FLD1 = TABLE2FLD1 INNER JOIN TABLE3 ON TABLE2FLD2 = TABLE3FLD2 INNER JOIN TABL4 ON  TABLE3FLD3 = TABLE4FLD3
    WHERE FLD1 = 'AA'
    Hope this may be helpful.
    Please reward points if found ok.
    Thanks and regards,
    Rajeshwar.

  • Query to Join three queries

    Hi,
    I have three queries as follows. I want to write a single query by using these three queries. can any one please help me out to write the query.
    Query 1:
    SELECT a_name,
    b_item_typ_cd,
    item_num,
    a_m_name,
    DECODE(RTRIM(LTRIM(t_clasfn_cd)),NULL,NULL,
    ‘X’|| t_clasfn_cd) t_clasfn_cd,
    in_splt_pct,
    item_ind
    FROM ABC.a_cmpnt_w
    WHERE b_item_typ_cd IN ('A','U','I')
    ORDER BY DECODE(b_item_typ_cd,'A','A'||b_item_typ_cd,
    'U','B'||b_item_typ_cd,
    'C'||b_item_typ_cd);
    Query 2:
    SELECT a_name,
    b_item_typ_cd,
    item_num,
    a_m_name,
    DECODE(RTRIM(LTRIM(t_clasfn_cd)),NULL,NULL,
    ‘X’|| t_clasfn_cd) t_clasfn_cd,
    in_splt_pct,
    item_ind
    FROM ABC.a_cmpnt_w
    WHERE b_item_typ_cd IN ('U','I')
    ORDER BY DECODE(b_item_typ_cd,'U','A'||b_item_typ_cd,
    'B'||b_item_typ_cd);
    Query 3:
    SELECT a.item_num
    FROM ABC.item a, ABC.X2_PRDT_LN b
    WHERE a. PRDT_LN_CD= b. PRDT_LN_CD
    AND b. t_clasfn_cd = t_clasfn_cd
    so I want to write a single query .
    Thanks.

    Try this..
    SELECT a_name,
    b_item_typ_cd,
    item_num,
    a_m_name,
    DECODE(RTRIM(LTRIM(t_clasfn_cd)),NULL,NULL,
    ‘X’|| t_clasfn_cd) t_clasfn_cd,
    in_splt_pct,
    item_ind
    FROM ABC.a_cmpnt_w
    WHERE b_item_typ_cd IN ('A','U','I')
    --ORDER BY DECODE(b_item_typ_cd,'A','A'||b_item_typ_cd,'U','B'||b_item_typ_cd,'C'||b_item_typ_cd);
    union all
    SELECT a_name,
    b_item_typ_cd,
    item_num,
    a_m_name,
    DECODE(RTRIM(LTRIM(t_clasfn_cd)),NULL,NULL,
    ‘X’|| t_clasfn_cd) t_clasfn_cd,
    in_splt_pct,
    item_ind
    FROM ABC.a_cmpnt_w
    WHERE b_item_typ_cd IN ('U','I')
    --ORDER BY DECODE(b_item_typ_cd,'U','A'||b_item_typ_cd,'B'||b_item_typ_cd);
    union all
    SELECT NULL,NULL,a.item_num,NULL,NULL,NULL,NULL
    FROM ABC.item a, ABC.X2_PRDT_LN b
    WHERE a. PRDT_LN_CD= b. PRDT_LN_CD
    AND b. t_clasfn_cd = t_clasfn_cd)U have to remove the order by clause from indiviual queruies,but u can use order by at the end..
    And for union u must have same no of columns in each query..
    Regards
    Umesh

  • How to join three dimension tables

    I have one seperate schema, which consists of only 3 tables(all three tables has dimension fields and fact fields(dim fields =textual fields,fact fields=measures))
    How to handle this type of situation in RPD.
    Ex: table A,Table b,Table c
    Table A needs to join with Table b on many to one relationship.
    Table c needs to join with table b on many to one relationship.
    Anyone suggest me what is the best way to handle this type of situation.do I require to create dimensional hierarchies for all three tables? Or can I consider only table b as dimension and remaining 2 consider as fact?

    This will not be possible. As per dimensional modelling atleast you should have one fact table.
    Dimensional tables can be joined to one another if the have flakes(sightly normalized table).
    so you have start up the things from DWH.
    Regards,
    Kishore.

  • How to join three or more blocks in a form (like master/detail)

    I have four data blocks for four tables, lets call them blocks A, B, C, D
    Block A is a master block and block B is a detail block, block B holds a foreign key from block A (ofcourse)
    Now when i choose in a query data from block A it lists also data from detail block that is corresponding, but now.....
    detail block B also holds another foreign key from block C which takes his key from block D. and
    i want to make a form that will, when i query master block A, show some data from block B, C and D that is
    corresponding to block A.How do i do that?
    i'm using 10g and i am a begginer

    In each Data Block there are three nodes - triggers, items, and relations. The relations node is what you use to link the master to the detail. If you highlight the Relations node and press create a window will open to create your "New Relation". The master block is already entered because it is the block that you are currently in. You can then pick a detail block by pressing the "select..." button or just type the name of the block in. So if you did this in block A, you would enter B as your detail block. You will then need to enter a join condition. If the PK in block A is named A_DETAIL and the FK in block B is the same name, then you can just type in A_DETAIL, press OK, and the relationship will be automatically created. If the names are different then you could put in a join condition like A.A_DETAIL = B.B_A_DETAIL (whatever the names of the blocks and items are). You can then repeat this process for every parent-child relationship.

  • How to join two queries

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    _1st query_
    select
    (CASE WHEN SUBSTR(R1.RA_NO,1,3)= 'NRA' THEN 'Damansara Uptown One Sdn. Bhd.'
    WHEN SUBSTR(R1.RA_NO,1,3)= 'ORA' THEN 'Damansara Uptown Two Sdn. Bhd.'
    WHEN SUBSTR(R1.RA_NO,1,3)= 'VRA' THEN 'Damansara Uptown Realty Sdn. Bhd.'
    WHEN SUBSTR(R1.RA_NO,1,3)= 'URA' THEN 'Uptown Elite Sdn. Bhd.'
    when SUBSTR(R1.RA_NO,1,3)= 'WRZ' THEN 'U5 Management Corporation Sdn. Bhd.'
    WHEN SUBSTR(R1.RA_NO,1,2)= 'FR' THEN 'See Hoy Chan Facilities Management Sdn.Bhd.' END) Landlord
    ,TO_CHAR(C1.COLL_DTE,'RRRRMM') MONTH1
    ,SUM(C2.TRN_AMT) UPTO_31
    , SUM(CASE WHEN to_char(C1.COLL_dte) BETWEEN to_date(:P_FROM_DATE,'dd.mm.yyyy') AND '16-'||to_date(:P_TO_DATE,'dd.mm.yyyy') THEN C2.TRN_AMT END) UPTO_15
    from ra1 R1, COLLECT1 C1 , COLLECT2 C2
    where
    (to_char(C1.COLL_dte) between to_date(:P_FROM_DATE,'dd.mm.yyyy') AND to_date(:P_TO_DATE,'dd.mm.yyyy'))
    and (SUBSTR(R1.RA_NO,1,2)= 'FR' or SUBSTR(R1.RA_NO,1,3) in ('NRA' ,'ORA','VRA','URA','WRZ'))
    AND R1.RA_NO = C2.INV_NO
    AND C2.COLL_NO = C1.COLL_NO
    GROUP BY
    (CASE WHEN SUBSTR(R1.RA_NO,1,3)= 'NRA' THEN 'Damansara Uptown One Sdn. Bhd.'
    WHEN SUBSTR(R1.RA_NO,1,3)= 'ORA' THEN 'Damansara Uptown Two Sdn. Bhd.'
    WHEN SUBSTR(R1.RA_NO,1,3)= 'VRA' THEN 'Damansara Uptown Realty Sdn. Bhd.'
    WHEN SUBSTR(R1.RA_NO,1,3)= 'URA' THEN 'Uptown Elite Sdn. Bhd.'
    when SUBSTR(R1.RA_NO,1,3)= 'WRZ' THEN 'U5 Management Corporation Sdn. Bhd.'
    WHEN SUBSTR(R1.RA_NO,1,2)= 'FR' THEN 'See Hoy Chan Facilities Management Sdn.Bhd.' END)
    ,TO_CHAR(C1.COLL_DTE,'RRRRMM')
    _2query_
    select sum(decode(substr(ra_no,1,7),'NRA'
    ||to_char(to_date(:P_FROM_DATE,'dd.mm.yyyy'),'yymm'),tot_amt,0)) NRA
    ,sum(decode(substr(ra_no,1,7),'VRA'
    ||to_char(to_date(:P_FROM_DATE,'dd.mm.yyyy'),'yymm'),tot_amt,0)) VRA
    ,sum(decode(substr(ra_no,1,7),'ORA'
    ||to_char(to_date(:P_FROM_DATE,'dd.mm.yyyy'),'yymm'),tot_amt,0)) ORA
    ,sum(decode(substr(ra_no,1,7),'FR'
    ||to_char(to_date(:P_FROM_DATE,'dd.mm.yyyy'),'yymm'),tot_amt,0)) FR
    ,sum(decode(substr(ra_no,1,7),'WRZ'
    ||to_char(to_date(:P_FROM_DATE,'dd.mm.yyyy'),'yymm'),tot_amt,0)) WRZ
    ,sum(decode(substr(ra_no,1,7),'URA'
    ||to_char(to_date(:P_FROM_DATE,'dd.mm.yyyy'),'yymm'),tot_amt,0)) URA
    from RA1
    above are the two queries i need to join these two queries by naming the second query column name as total .

    1st query output  is ----------
    LOCATION                                                                 MONTH1    UPTO_31           UPTO_15        
    U5 Management Corporation Sdn. Bhd.                           201001     15250                8900                                 
    Uptown Elite Sdn. Bhd.                                                201001      3000                 1500                                 
    See Hoy Chan Facilities Management Sdn.Bhd.                 201001      917115.45         584876.5                            
    Damansara Uptown Two Sdn. Bhd.                                201001      757277.45         495362.95                          
    Damansara Uptown One Sdn. Bhd.                                 201001     881558.65          404872.45                          
    Damansara Uptown Realty Sdn. Bhd.                              201001      321675.8           150508.6                              
    2nd query output is -------
    NRA              ORA              VRA              URA              WRZ           FR
    2323.31        95945           34367.8        34267            4343         343
    Now what i need is
    LOCATION                                                                 MONTH1    UPTO_31           UPTO_15          TOTAL
    U5 Management Corporation Sdn. Bhd.                           201001     15250                8900                2323.31                 
    Uptown Elite Sdn. Bhd.                                                201001      3000                 1500                95945                  
    See Hoy Chan Facilities Management Sdn.Bhd.                 201001      917115.45         584876.5           34367.8                  
    Damansara Uptown Two Sdn. Bhd.                                201001      757277.45         495362.95          34267                 
    Damansara Uptown One Sdn. Bhd.                                 201001     881558.65          404872.45           4343
    Damansara Uptown Realty Sdn. Bhd.                              201001      321675.8           150508.6           343above is the clear picture what i need , i don't know how to do it please help me
    Edited by: user9093689 on Feb 21, 2010 8:06 PM

  • How to join three symbols as shown here in wwi using its features

    hello I want to connect three symbols in this position using wwi techniques but was not able to do rotation and use text box to join these object . any help

    Dear M D
    I am not 100% sure If I understood your requirement The symbols are related to GHS; therefore this type of demand is coming up often; but there are many solutions to handle it; many of them are "quite" tricky to use. Can you show your current result in WWI layout? How doees it look like now? And which WWi code did you use?
    C.B.

  • How to join three independen​t vi programs

    I have three independent vi programs running successfully. Now I would like to join them together and would like to run in sequence. How can I do that ?
    Plz look at the attached files. I would like to run in the sequence of send string, voltage measurement and then again send string. Plz help. Is it possible to write the voltage output program separately very similar to the send string vi having error in and error out wires ?
    Attachments:
    MCRS_sendString.vi ‏42 KB
    MercLib210.dll ‏212 KB
    single-point_voltage.vi ‏26 KB

    Here's a few notes that explain how to configure the Connector Pane. I took these directly from the LabVIEW Help File.
    Selecting a Connector Pane Pattern
    Complete the following steps to select a connector pane pattern for a VI.
    Right-click the icon in the upper right corner of the front panel window and select Show Connector from the shortcut menu to display the connector pane. The connector pane replaces the icon.
    LabVIEW selects a default connector pane pattern for the VI with as many terminals on the left of the connector pane as controls on the front panel and as many terminals on the right of the connector pane as indicators on the front panel. If this is not possible, LabVIEW selects the closest match. If the VI does not have any controls or indicators, LabVIEW selects a connector pane with one terminal.
    To select a different connector pane pattern for your VI, right-click the connector pane and select Patterns from the shortcut menu. A solid border highlights the pattern currently associated with your icon. To change the pattern, select a new one.
    After you select a connector pane pattern, you can customize it to suit your VI by adding, removing, or rotating the terminals.
    To add a terminal to the pattern, place the cursor where you want to add the terminal, right-click, and select Add Terminal from the shortcut menu.
    Note: Assigning more than 16 terminals to a VI might decrease performance and reliability. Too many terminals also can reduce the readability and usability of the VI.
    To remove an existing terminal from the pattern, right-click the terminal and select Remove Terminal from the shortcut menu.
    To change the spatial arrangement of the connector pane patterns, right-click the connector pane and select Flip Horizontal, Flip Vertical, or Rotate 90 Degrees from the shortcut menu.
    Assigning Terminals to Controls and Indicators
    After you select a pattern to use for the connector pane, you must assign a front panel control or indicator to each of the connector pane terminals. When you link controls and indicators to the connector pane, place inputs on the left and outputs on the right to prevent complicated or confusing wiring patterns in your VIs.
    Complete the following steps to assign terminals to controls and indicators in a connector pane.
    Right-click the icon in the upper right corner of the front panel window and select Show Connector from the shortcut menu to display the connector pane. The connector pane replaces the icon.
    Click a terminal of the connector pane. The tool automatically changes to the Wiring tool, and the terminal turns black. Although you use the Wiring tool to assign terminals on the connector pane to front panel controls and indicators, no wires are drawn between the connector pane and these controls and indicators.
    Click the front panel control or indicator you want to assign to the terminal. A marquee highlights the object.
    Click an open space of the front panel. The marquee disappears, and the terminal changes to the data type color of the control to indicate that you connected the terminal.
    Note: If the connector pane terminal turns white, a connection was not made. Repeat steps 1 through 3 until the connector pane terminal changes to the proper data type color.
    Repeat steps 2 through 4 for each control and indicator you want to assign to a terminal.
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Join of queries

    Hello All
    Can someone tell me how to join two queries without using a multicube
    or infoprovider option.
    First Query has x, y, z fields
    Second Query has x,a,b fields
    now can i join the first and second query by the common field x.
    Without changing the infoprovider or multicube design,i want to join
    the query at the query level.
    I want to join the two queries using common field x and then replace
    the second query a, b fields with y, z fields data of query1.
    Regards

    Hi Santosh.
    If you want to use the workbook solution you should create one sheet for each query.
    Lets assume that you have X in column A in both sheets and Y and Z in column B and C in sheet1. For the columns D and E on sheet1 you should insert some VB-code that gets the data from sheet2 where X equals X from sheet1. Here is an example:
    =IF(ISNA(VLOOKUP(A1;sheet2!$A$1:$B$200;2;FALSE));"";(VLOOKUP(A1;sheet2!$A$1:$B$200;2;FALSE)))
    You will have to use this code for all the rows along the column. I.e. if A has an output of 200 rows, you will need the code from line 1->200. You will also have to consider that the results may be more in the future.
    Hope it helps.
    BR
    Stefan

  • How to get rid of the SAP BPC "three globes" startup screen?

    Hi,
    I am trying to figure out how to get rid of the SAP BPC "three globes" startup screen when we start BPC. I do not want it to pop up.
    I looked at VBA behind the workbooks but could not find anything. Could not make the sheet invisible.
    Is there a way to get rid of the screen? This is the screenshot
    www.flickr.com/photos/chalinka/3471310254/
    Thanks!

    Just found the answer on this very forum!
    Re: How to change the logo, (3 Globes) on the launch page
    Posted: Mar 18, 2009 12:46 PM in response to: David Fletcher Reply
    OK then, now v7sp03 for microsoft has hit the shelves, you can change the logo !!!
    It is quite easy.
    Have the logo file ready in either BMP, GIF or JPG format.
    Put it in your "Server Install -> DataWebFolders[Appset]" folder (so where you keep your files).
    In ApplicationSet parameters, add the parameter COMPANY_LOGO and in the options type the name of the file you just put on the server.
    Now if you restart BPC for Excel, the second excel page that pops up should be showing your new logo or graphic (mine did).
    The use of the logo has been documented in the admin manual -> working with appset parameters
    Some tips.
    I wanted not to clutter the filesystem so i put my logo in the appsetpublications folder and added the path accordingly in the parameter (so now it reads appsetpublicationslogoname.jpg instead of just logoname.jpg).
    If you do not supply a name (only the parameter), your second Excel window (normally holding the graphic) will not appear. That could be an alternative too if you find that whole thing annoying.
    Hope this helps you build great BPC apps,
    Edwin van Geel

  • How to send three attachments using three queries in a single email using sp_senddbmail

    Hi All,
    I have three scripts for extracting permissions at server,database & object level.Now how do i can execute all three queries and send multiple attachments in a single email using sp_senddbmail.I have done this before for single queries but not multiple
    queries. Kindly suggest.
    Regards
    Rahul

    Hi All,
    The requirement was that i had three different queries for listing permissions at server,database and object level.I wanted to build an solution to email results in attachment to user.
    However i have managed to do this with SSIS Package.I was curious to know if it can be done without SSIS.
    Thanks you all for your time and effort for this.
    Rahul
    It can be done without SSIS
    Just have a procedure to return  three query results as a single resultset. Then use sp_send_dbmail to execute query and send results as a email
    See
    http://blogs.msdn.com/b/sqlagent/archive/2010/11/03/sql-database-mail-send-t-sql-results-by-email.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How can I join to queries?

    Hello all,
    I would like to ask if there is a way to join two queries into another new one.
    I've been trying including two structures from two queries (always from the same infoprovider) but the result is not what I'm looking for.
    Has anyone any idea of how to do this?
    Thank you very much,
    Carlos Hinestrosa

    Hi Michael,
    Thanks for your answer. I know there are lots of funtionalities in excel but I need the result of the query as simple as it is to work with it in SEM Balanced Scorecard / Management Cockpit because SEM does not support many BEX funtionalities.
    I make some calculations in one query and others in the other query, and I need the result of thoese calculations to make further calculations in a new query.
    I was trying to create a query but the dialog box only allows to create a query from a cube.
    Thanks,
    Carlos Hinestrosa

  • How to join these two queries

    Hi experts,
    I need to join two queries but not sure how:
    select id from test_table1;
    select *
      from table(f_function(null
                           ,null
                           ,1 -- the id
                           ,sysdate);One query has IDs needed to run the second query. Is there a way to join those two?
    The result should be all columns from test_table1 + all columns from f_function.
    Best regards,
    Igor
    Edited by: Igor S. on Mar 8, 2013 5:18 AM

    Hi,
    Igor S. wrote:
    select  *
    from  test_table1,
    table(
    f_function(
    null,
    null,
    id,
    sysdate
    select  *
    from  test_table1,
    table(
    f_function(
    null,
    null,
    id,
    sysdate
    ) xyz
    where test_table1.id = xyz.id
    /So these two queries are the same?Try it and see.
    You'll find that the 2nd one produces an error. But if you change it to
    select  *
      from  test_table1,
            table(
                  f_function(
                             null,
                             null,
                             id,
                             sysdate
                            )      -- No alias here
                 ) xyz             -- Alias here, instead
    where test_table1.id = xyz.id
    /Then, assuming f_function produces a column called id, it will work.
    Whether it produces the same results or not depends on what the function returns, and whether either id is NULL.
    If the id column that the function returns is the same as the id value that you pass to it, and is never NULL, then the 2 queries will produce the same results.
    Either way, each row of test_table1 will be joined to each row that the function produces with the argument(s) from that row. The column names produced by the function and the values in those columns are determined by the function; they do not need to have anything in common with any table. In practice, a function like f_function will usually not return an column that is always identical to any of its inputs, since that value is already available from the input.

Maybe you are looking for

  • Using a digital projector

    I am connecting my macbook pro to an epson digital overhead projector and I have had it working for a few months. Today I connected it and it would not work, i tried rebooting changing projectors changing display settings but nothing worked. What cou

  • Query in Table Maintanance Generator

    Hi, I have a query in table maintanance generator. In tables Extract and Total we have all the entries. Is it possible to get the entry which we made in the record. I mean i need the record in this i made the changes. I cant use above tqo tables beca

  • Adobe Air necessary for CS6?

    On a fresh install of Lion, I now see Adobe Air Installer and Uninstaller. Not sure what they do, but wanted to see if they are needed by CS6. I'm only running Photoshop, Illustrator, InDesign and Adobe Bridge. Thanks for any help.

  • RAM & PREVIEW

    Hi. Question about Premiere Pro CS6 I have laptop ( ASUS N56VZ-S4044V - http://www.notebookcheck.net/Review-Asus-N56VZ-S4044V-Notebook.78305.0.html ) with 8GB RAM (2x4GB DDR3 SDRAM PC3-12800 800MHz Dual-channel (1600MHz) (Model: HMT351S6CFR8C-PB)) an

  • I don't know how to delete a dashboard option...

    I've accidentally added a website to my dashboard and now it shows up all the time. How do I delete it??