2 right joins - how to add another right join to this statement?

Hi all,
I had to upgrade my sql statement and add another column. my previuos sql was:
          SELECT TR.ID, TA.Name, TR.idTarget, TR.Controller_Status, TR.previuosYear, TR.deduction, TR.idProduction, SUM(CSV.cur_amount) AS Accumulated,    PD.Name AS PName, PD.type_2, CL.ToRange AS growth
          FROM agent AS TA, production_name AS PD, calculation AS CL, target AS TR
          RIGHT JOIN csv_production AS CSV ON CSV.ID=TR.ID AND CSV.Production_Date BETWEEN '2006-10-01' AND '2006-12-31'
          WHERE TA.ID=TR.ID
          AND PD.idProduction = TR.idProduction
          AND CL.idCalculation = ANY (SELECT MIN(idCalculation) FROM calculation GROUP BY idProduction)
          AND TR.idProduction=CL.idProduction
          AND TR.startDate= '2006-10-01' AND TR.endDate='2006-12-31'
          GROUP BY CSV.IDI had to add this line:
RIGHT JOIN csv_net_production AS CSV_net ON CSV_net.IATA=TR.IATA AND CSV_net.Production_Date BETWEEN '2006-10-01' AND '2006-12-31'  my end result looks like this:
          SELECT TR.ID, TA.Name, TR.idTarget, TR.Controller_Status, TR.previuosYear, TR.deduction, TR.idProduction, SUM(CSV.cur_amount) AS Accumulated,  SUM(CSV_net.cur_amount) AS net_Accumulated, PD.Name AS PName, PD.type_2, CL.ToRange AS growth
          FROM agent AS TA, production_name AS PD, calculation AS CL, target AS TR
          RIGHT JOIN csv_production AS CSV ON CSV.ID=TR.ID AND CSV.Production_Date BETWEEN '2006-10-01' AND '2006-12-31'
                           RIGHT JOIN csv_net_production AS CSV_net ON CSV_net.ID=TR.ID AND CSV_net.Production_Date BETWEEN '2006-10-01' AND '2006-12-31' 
          WHERE TA.ID=TR.ID
          AND PD.idProduction = TR.idProduction
          AND CL.idCalculation = ANY (SELECT MIN(idCalculation) FROM calculation GROUP BY idProduction)
          AND TR.idProduction=CL.idProduction
          AND TR.startDate= '2006-10-01' AND TR.endDate='2006-12-31'
          GROUP BY CSV.IDBUT!!! the accumulated (Accumulated, net_Accumulated,) is multiplied by 3, which means that I must add another WHERE statement (i think?!)
thanks for any pointers

how do u relate csv_production ,csv_net_production ?
the one comparison i viewed is TR.ID against the IDs of these 2 tables
I mean
is there any relationship between these 2 tables?
specifically
is there any referencial integrity or like constraint exists between these 2 tables?
if so u can write a where condition csv_production.ID=csv_net_production.ID

Similar Messages

  • How to add another Chapter Page for more then 6 chapters & add right arrow?

    Hello,
    I created a project via the Magic iDVD option and it worked great and added multiple chapter pages for more then 6 chapters. Now, I manually added a submeno off of main and added 6 chapters but I need multiple pages since I have 40 chapters... I can't figure out how to add another chapter page and create a RIGHT ARROW navigation button for the next pages...
    I also looked at the map view and see that on the working pages there is page connected to page... I also cannot find a way to add a page connected vi map view...
    I have searched the forum but none of the answers were clear on how to do this... any help would be appreciated...
    Thanks! T.

    Adding the submenu is easy...making the button for it a "right arrow" is not.
    You can keep adding submenus to other submemus by navigating to the appropriate menu and then choose the "add submenu" command from the iDVD project menu. This can be done in either normal or map view.
    However, this creates a "folder" button, (or other things in some themes) not a right arrow. I agree it should be a choice! My 2nd best solution is to chage the folder button to a "text only button" and label it "More Chapters > >"
    Another solution (3rd best??) is to use command-shift-4 when you are one one of your other menus that DOES have a right arrow, and take a mini picture of the arrow. Then choose one of the oval menu buttons on the button pane, and drag this tiny picture onto the button. Re-size it to make it close to the same size as your other buttons. It will have a funny edge on it from the button style, but it will look like a right arrow.
    John B

  • How to add another secure url in web.xml?

    hello i want to secure my web application i have two kind of users i have users and admin.each of them has each certificat users have permission to enter /users and admin have permission to enter /admins/ but i want also users to enter another folder which is /otheruserplace how can i add this in my web.xml file here is my code
    http://pastebin.com/m3e13d3d9

    Just add another url-pattern.
    This has nothing to do with JSF however. More suitable place would have been the Servlets forum.

  • Custom display template - how to add anothe display template for refimement item?

    Custom display template - how to add anothe display template for refimement item?
    I add a new filter_default_custom.html file and want to create new refinement item display template to point to it
    keren tsur

    Not 100% if I understood the question, but if you uploaded your template to the Master Gallery and the corresponding .js file has been created, you can open the refinement config panel and specify the result type you want to map to your custom template.
    http://www.eliostruyf.com/part-1-create-first-search-refiner-control-template/
    Kind Regards
    Bjoern
    http://www.sharepointviking.com
    Twitter: Follow @bjoern_rapp

  • TS1368 my brother has an iphone and his details are on my computrer i have just purchased an iphone and now have all his stuff on my phone. ive created an apple id but i still dont know how to add another phone to the apple account! please help

    my brother has an iphone and his details are on my computrer i have just purchased an iphone and now have all his stuff on my phone. ive created an apple id but i still dont know how to add another phone to the apple account! please help

    when you open the app store scroll down to the bottom it will display the apple id currently in use, change it to your normal apple id email

  • How to add the Assignment column on this post outgoing payment in f-53

    Hi all,
    how to add the Assignment column on this post outgoing payment in f-53?
    thanks.
    Joo

    Hi ,
    If you want to see the assignment column in f-53 process open item screen
    1. First in O7V3 check for t.code FBz2 which line layout ( 2 digit code is assigned)
    2. Then in t.code O7z4s check in the line layout and if assignment field is not there then insert the field.
    then check in F-53.
    Hopw it will solve your problem.
    Assign points if useful
    Regards
    Prabhat

  • How to add another Planning Server to the Shared Connections?

    Hi,
    This is for version 11.1.2.1.103
    Currently all of our users use Planning in Prod environment. I would like to open the UAT environment to a smaller set of users. UAT environment is in our Test environment. I couldn't figure it how to add the UAT environment to the current Prod Shared Connections. I was hoping it would be as easy as right click on the Prod Planning Server > click on Add > Add the UAT server > Click OK.
    Instead I had to follow couple of steps to add the UAT environment to the SV:
    1. SmartView > Options > Advanced > Edit Shared Connections URL with UAT environment URL > Click OK
    2. Connect to Shared Connections > Planning
    3. Right click on the Plan Type > Click on Add to Private Connections
    4. Follow the same steps for the PROD Plan Type.
    Now, I do have two environments under Private Connections and I do not need to follow the first step every time I want to switch between environments.
    Was it a overkill or I did it right?
    Thanks,
    Mehmet
    p.s. I just noticed that in Shared Connections, you can add another Essbase Server, but that's not an option for Planning.
    Edited by: Mehmet Sevinc on May 8, 2012 2:48 PM

    Hi Again,
    following up my previous comment on this, you can create a macro and assign to an event or macro in the excel to change shared connection URL.
    Declare Function HypSetSharedConnectionsURL Lib "HsAddin" (ByVal vtAPSURL As Variant) As Long
    Sub SubHypSetSharedConnectionsURLTest()
    Dim lRet As Long
    lRet = HypSetSharedConnectionsURL("http://UATserver:19000/workspace/SmartViewProviders")
    End Sub
    http://docs.oracle.com/cd/E17236_01/epm.1112/sv_user/ch17s01s08s10.html
    Hope this helps,
    Ahmet

  • Urgent! How to add another text field using Servlet

    Hi all,
    I'm using Java Servlet to create a submit page. I want to let users to submit their products and as many as they like.
    What I made several chechboxs of common products on the first part of the page, so that users can simply select from these common products. If they have more to submit, they can click a "Add" button, then another textfield is supposed to appear in the same page below the "Add" button and user can type in, then if they have more, they click "Add", another textfiled should apprear under the first added textfield, so on and so on. After finishing type in all their products, they can click "submit" button to submit to the database.
    I want all the inputed data stay in the same page when user add more and more, so that they can alwasy see and change before submit. I had problem to detect the "Add" button and add new textfield while keeping all the data user has already inputed. How can I do this?
    Tons of thanks!
    Victor

    Hi
    I normally use "hidden" tables for something like this. To accomplish the effect I use JavaScript and a stylesheet. Remember once the servlet sent the page to the browser, it can't interact with it anymore - you'll have to use client side script - which off course you can sent as part of your servlet output :-). I'm including some code that will get you on your way...
    Style Sheet Code:.hide {display:none};
    .show {display:block};
    Java Script Code:var current = 0;
    function showMore() {
      if (current < 5) {
        current++;
        switch (current) {
          case 2:
            document.getElementById("showme2").style.display = "block";
            break;
          case 3:
            document.getElementById("showme3").style.display = "block";
            break;
          case 4:
            document.getElementById("showme4").style.display = "block";
            break;
          case 5:
            document.getElementById("showme5").style.display = "block";
            break;
    function showLess() {
      if (current > 1) {
        switch (current) {
          case 2:
            document.getElementById("showme2").style.display = "none";
            document.forms[0].term[1].value = "";
            break;
          case 3:
            document.getElementById("showme3").style.display = "none";
            document.forms[0].term[2].value = "";
            break;
          case 4:
            document.getElementById("showme4").style.display = "none";
            document.forms[0].term[3].value = "";
            break;
          case 5:
            document.getElementById("showme5").style.display = "none";
            document.forms[0].term[4].value = "";
            break;
        current--;
    Extract from JSP page (easy to convert to normal servlet code):<!-- first row allways visible -->
    <table id="showme1" cellpadding="3" cellspacing="0" class="show">
         <tr><td><input type="text" name="someitem"></td></tr>
    </table>
    <!-- hide the rest for now -->
    <% for (int i = 2; i < 6; i++) { %>
    <table id="showme<%=i%>" cellpadding="3" cellspacing="0" class="hide">
         <tr><td><input type="text" name="someitem"></td></tr>
    </table>
    <% } %>There are other ways to do the JavaScript, but the code above is cross-browser :-). You'll see with the switch statement in the JavaScript, that there is a limit to the rows that gets displayed - adjust as you please, just remember to also update the loop that generates the tables. Also note that each text field has the same name! The result of this is that an array of these fields are submitted, so you're recieving servlet will need to loop through the array basically take appropriate action on the fields that don't contain an empty string. Something like:String[] items = request.getParameterValues("someitem");
    for (int i = 0; i < items.length; i++) {
        if (!items.trim().equals("")) {
    //do something

  • How to Add another path to UTL_FILE_DIR in 9i

    Hi,
    How can we add another path to an existing UTL_FILE_DIR value in Oracle 9i?
    Can we do this Dynamically so that it doesn't require a DB bounce
    Thanks in Adv
    Srikanth Tirandas

    Hi 397779
    you can repeat that parameter in the parameter file several times.
    UTL_FILE_DIR
    Parameter type
    String
    Syntax
    UTL_FILE_DIR = pathname
    Default value
    There is no default value.
    Parameter class
    Static
    Range of values
    Any valid directory path
    UTL_FILE_DIR lets you specify one or more directories that Oracle should use for PL/SQL file I/O. If you are specifying multiple directories, you must repeat the UTL_FILE_DIR parameter for each directory on separate lines of the initialization parameter file.
    All users can read or write to all files specified by this parameter. Therefore all PL/SQL users must be trusted with the information in the directories specified by this parameter.
    Note:
    If you list multiple values, all entries of this parameter must be on contiguous lines of the parameter file. If you separate them with other parameters, Oracle will read only the last (contiguous) lines
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96536/ch1221.htm#REFRN10230
    Joel Pèrez
    http//otn.oracle.com/experts

  • How to add another row dynamically in Adobe Forms ?

    Hello All,
      Can someone advise on how am I able to add another row to my table upon the click of a button in Adobe Form ?
    Based on some sample PDFs that I downloaded from the net as reference, it seems that all I need to do is add the statment "_Car.addInstance(1)" in the script editor that will trigger upon a clicking of a button where Car is a subform that is of Type : Flow Content and Direction : Table Row set.
      Any suggestion/advise will be greatly appreciated.
    from
    Kwok Wei

    Hello Kwok Wei,
    in NW 2004s, this will be possible on the client using a special forms library object provided by Adobe.
    Be aware, though, that while you are able to add any number of additional lines on the PDF, the original Web Dynpro context is not aware of these actions. This means that your application needs to create the corresponding new nodes in the context before the data contained in these nodes can be submitted back to the application.
    Regards,
    Markus Meisl
    SAP NetWeaver Product Management

  • How to add another Computer to my Apple TV?

    I've had my apple TV for a while and really like it. If I rember correctly it used to be easy to add another computer to my Computer list on Apple TV. But for some reason I can't seem to do it anymore.
    I intend to take my main home imac down for maintenance over the weekend. I run my itunes library from an external hard drive.
    What I want to do is take my external drive with my itunes library and connecvt it to my macbook and run my apple TV from there while my main imac is down.
    I thought that if I launched the itunes on the macbook, then enabled homesharing then my macbook would appear on my apple TV compuers list and I could just select it..
    But it doesn't!
    Any ideas?
    One thng that it maybe is that my apple TV is connected to my imac via a physical eithernet.
    Would it make sence to diosconnect that and go WiFi and then see if my apple TV picks up the macbook?
    Thanks for any advise!

    Is the MB setup with the same home sharing ID as the iMac? It should make no difference whether you are on wifi or ethernet, in fact any issues with discovery are typically related to wifi.

  • How to add another new report painter in existing T-code?

    HI,
    Can someone guide me, how to add a report painter report ZAL into a existing T-code?
    My T-code contain 2 report, now i wish to add a new one. So when user execute this T-code, we can see these 3 report.
    Thanks

    Hi,
    add the new report to the report group (T-code GR52) where the 2 already existing reports belong to.
    In report painter you don't execute a report but always a report group including one or more reports.
    Best regards, Christian

  • How to add another Segment field in OBC4

    Dear Experts,
    OBC4 -> select Comp. Code -> field Status Group -> select Field St. Grp -> Duuble click on Field St. Grp
    I have a requirement to make Business Place/secn field Mandatory where ever it is used in transaction F-43 , F-02 , F-48 .
    So for this am going through OBC4 . But there (Under Field status Grp.) am not getting any field named as Business Place . There exists a field Business Area . But Business Area and Business Place both are different .
    So Is it possible to add another segments named as Business Place/secn  there with 3 options Supress , Req. Entry , Opt. Entry . So that i can change it to Mandatory .
    Thanks in Advance
    Jack

    Hi,
    Check this sample process
    To get custom fields on IDOC you need to add custom segment on IDOC and for that you have to create a extension IDOC with reference to Basic IDOC.
    You can do that as explain below.
    Here for example you have basic idoc ORDERS05 and you want to add additional segments at header level - ZE1EDK01 and line item level ZE1EDP01
    1. TCode - WE31 : Create custom segments ZE1EDK01 and ZE1EDP01 with the fields you want and release these segments.
    2. TCode - WE30 : Create extension IDOC
    In WE20 enter extension IDOC name - ZORDERS05, select "Extension" option and hit "create" button. When it gives pop-up, select "create new" and enterd linked basis type as "ORDERS05". Enter proper description and save.
    3. On the next screen of WE30, select the segment under which you want to add your additional segment. Save everything.
    4. TCode - WE82. Here you link extension idoc to basic idoc and message type.
    Go into change mode. Hit "New entries button" Enter Message type = "ORDERS", basic type = "ORDERS05" and extension type = "ZORDERS05".
    Regards,
    Satish

  • How to add another background picture (GIF Animation)

    Hi Guys
    I am trying to create a simple animated gif.
    I have currently one picture which is the Background. I have created layers. Each layer has Text.
    My question is how to ad another picture for a background in my GIF animation project?

    Hi Curt.
    I just SELECTED + A (Windows), then control + c. then select the layer and make that specific frame with only the EYE available for the FRAME and paste. Bingo .

  • How to add another operating system for Dual boot in Windows 7 boot configuration

    Hi,
    I have dell laptop with excellent configuration. On which i had windows 7 Home premium on C Drive and Windows server 2008 on D Drive.
    Now i upgraded my Windows 7 Home Premium 32 bit to Windows 7 Ultimate 64 bit. But after fresh installation of Win 7 Ultimate my dual boot screen has gone and Win 7 is getting start directly.
    Now i want to add my Windows server 2008 again for dual boot which is still on D Drive.
    Can anyone please tell me how to add windows 2008 boot option in boot configuration to active my dual boot options.
    Thanks

    1) Using bcdedit.exe /enum
    To enable the computer to also boot Windows 7 you again use bcdedit.exe with the following command which will copy the current Windows
    Boot Loader details for Windows Server 2008 to Windows 7.
     bcdedit.exe /copy
    {current} /d "Microsoft Windows 7"
     bcdedit.exe will
    respond with something like the following.
    The
    entry was successfully copied to {................................}.
    Using
    bcdedit.exe /enum to again enumerate through the current entries within the BCD store you'll see the newly added entry.
    Before you can use the newly created Windows boot loader configuration, you'll need to change the partition for Windows 7 using
    the following two bcdedit.exe commands.
    bcdedit.exe /set {.................................} device partition=D:
    bcdedit.exe /set {.................................} osdevice partition=D:
    If you now reboot the system you should now be able to boot into either Windows Server 2008 or Windows 7.

Maybe you are looking for

  • How do you change the text messages privacy setting on the 5.0 version software?

    I updated my iPhone to the 5.0.1 software version. When I had the earlier software version I changed my text message privacy setting. Whenever I received text messages it would only state the name and "new text message" now that I updated I don't kno

  • Lightroom 3.2 and Camera Raw 6.2 final releases are available

    Lightroom 3.2 and Camera Raw 6.2 are now available as final releases on Adobe.com and through the update mechanisms available in Photoshop CS5 and Lightroom 3.  These updates include additional lens profiles support among others. Check out http://blo

  • How do I connect a mac mini to my G5?

    Hi I wondered if anybody could give me some advice. I have a G5 at home running CS - the first version. My boss at work has just bought a mac mini for me and I've installed CS4 - the mini is connected to a random HP monitor at work. I wanted to bring

  • User-id / Roles  assigned in Solution Manager system

    Hi Friends, I need an information regarding following: User-id / Roles  assigned in   SOLMAN Dev system    SM59 Destinations in Solman dev system  & user-id/pwd used  for connecting to Satellite systems User-id/ Roles assigned in   Satellite systems 

  • Show Error Details

    Hello ,    I have create a suom login page.  when I try to login I get the following error "The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (ei