Two select commands in one item doesn't work?

I've created an item in a region which contains one select sentence which goes like:
select sum(r.amount * price.prices * re.sats * ac.sats)
from registration r, pricetype price, ressoucecostdriver re, activitycostdriver ac
where
r.art_art_id = price.art_art_id
and r.activity_activity_id = 42
and re.ressourcecostdriver_id = 47
and ac.activitycostdriver_id = 53;
to that sentence I need to add the following select sentence as a sum of this one and the previous select sentence
select sum(r.amount * price.prices)
from registration r, pricetype price
where
r.art_art_id = price.art_art_id
and r.activity_activity_id = 22
So what I really need is the sum (sum(r.amount * price.prices) + sum(r.amount * price.prices * re.sats * ac.sats)) so to say, but without the where sentences is the same.
I've tried to "rename" the last select sentence to somthing like
select sum(rr.amount * priceprice.prices) to avoid the where constraints to apply for both of the select sentences, but that doesn't work apparently.
Can anyone help me?

Morten,
If you look closely at the query I posted for you, I have used WITH statements to encompass each of your two queries, I then (in the last line) perform a simple select from those queries, you could simply add the two values together there if you like.
For example -
jes@TESTDB>  with tab1 as (select 1 as num1 from dual),
  2  tab2 as (select 2 as num2 from dual)
  3* select num1, num2, (num1+num2) as num3  from tab1, tab2
      NUM1       NUM2       NUM3
         1          2          3
jes@TESTDB>  with tab1 as (select 1 as num1 from dual),
  2      tab2 as (select 2 as num2 from dual)
  3*    select (num1+num2) as num3  from tab1, tab2
      NUM3
         3

Similar Messages

  • Two LOV queries in one item... is it possible??

    Hi,
    I have created a list of value in DML form as below-
    select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    from ptcs_cost_record_status pcrs
    But, depends on "pcrs.port_cost_record_status_id" I only want certain values to show on the list.
    For example:
    --if pcrs.port_cost_record_status_id is 2
    --then show status 2,3,4
    select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    from ptcs_cost_record_status pcrs
    where pcrs.port_cost_record_status_id in (2,3,4)
    --if status id  is 1
    --then show status 1,5
    select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    from ptcs_cost_record_status pcrs
    where pcrs.port_cost_record_status_id in (1,5)
    Any ideas on how I can have two different LOV in one item?
    Thank you!!
    Ling

    LC wrote:
    Hi,
    port_cost_record_status_id is an ITEM and it will be retrieved from database when the form is opened.It doesn't look like one (the convention being that page items are prefixed with their page number, and referenced as bind variables using ":").
    With respect to the original question above, the LOV query is:
    select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    from ptcs_cost_record_status pcrs
    where pcrs.port_cost_record_status_id in (2,3,4)
    and :p1_port_cost_record_status_id = 2
    union all
    select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    from ptcs_cost_record_status pcrs
    where pcrs.port_cost_record_status_id in (1,5)
    and :p1_port_cost_record_status_id = 1

  • Select more than one item in a SUD listbox?

    Is there a way to select more than one item in a listbox in a SUD? I can't find anything in the properties relating to that. I want to be able to select one or more items in a listbox just like I can in LabVIEW.
    George

    I tried to do this a while back but had no luck so I took another approach. I ended up using a table instead of a listbox. Here is a link to my posting a while back. Brad's example worked well for me.
    http://forums.ni.com/ni/board/message?board.id=60&message.id=1711&query.id=0#M1711
    Good luck,
    AJL

  • Getting two selection screen in one report

    Hello Friends,
    I am Making report, In my report on first screen i have given two pushbutton, like this :
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    PARAMETERS : p1_but RADIOBUTTON GROUP g1,
                             p2_but RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b2.
    now i want when user click on any one pushbutton it shows another selection screen, whose select options are:
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS: so_erdat FOR lf_date,
                    so_vbeln FOR lf_vbeln MATCHCODE OBJECT zvbeln..
    SELECTION-SCREEN END OF  BLOCK b1.
    Please guide me can i use two selection screen in one report?, If yes then how can I use? Please revert back me as soon as possible.........

    Hi,
    you can achieve it only by using two USER_DEFINE_SELECTION SCREEN.
    For detail check the link
    http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dba83d35c111d1829f0000e829fbfe/content.htm
    Regards,
    anirban

  • Import Two Price Lists for one item

    Hi all,
    How we can import two price lits for one item and how to link it.
    For eg.
    Suppose Item A is having price 100 Rs today at 11 am
    and its price changes to 150 RS at 1 Pm.
    how we can do this.
    We also want to see the last price of that item.
    Reply
    Thanks,
    Neetu

    Neetu,
    What do you mean by changing?  Does the Item price flactuate throughout the day every day..if so you need to create a routine to import/update the pricelist constantly.
    If the 11 am and 1 pm are constant times when the prices change then you can maintain a pricelist for each one of them.
    Shooting for a solution without knowing the business background can be a bit wasteful.  If you might want to throw some light on the type of business and what the prices are for..
    I also see you have posted the same question earlier..Price Updation
    I would suggest that you post only one thread for one question.

  • Every time I download a new app or update an old one it doesn't work. It gives an error message saying it is unable to download the application. I have 2 choices. Retry or done. Retry doesn't work so I press done. What can I do to fix this?

    Every time I download a new app or update an old one it doesn't work. It gives an error message saying it is unable to download the application. I have 2 choices. Retry or done. Retry doesn't work so I press done. What can I do to fix this? Someone please help!

    Try using Google's DNS instead of the one your IPS is providing.
    - To change on the iPod go to Settings>wifi and change the DNS to 8.8.8.8
    - For the computer see:
    Public DNS — Google Developers
    - Did anything happen to your router right before this started? Maybe the router is blocking the port used.

  • I have purchased the new apple earpods a while ago (few months). And I was wondering if I can use my warranty cause one earpod doesn't work anymore

    I have purchased the new apple earpods a while ago (few months). And I was wondering if I can use my warranty cause one earpod doesn't work anymore.
    So please help!

    See this:  Using iPad or iPod with multiple computers, http://support.apple.com/kb/HT1202

  • Selecting more then one item in ITunes

    Trying to clean up library and need to delete a number of files/items. I see that you can only command and click each individual file to select more then one but is there a easier way to do this? Want to be able to scroll over selection... then delete.
    Also when you use option show duplicates this also shows the original as well as the duplicate? Is there a way to ONLY show the duplicate file. So that to would be easier to delete?
    Thanks in advance.

    Shift click to select multiple items from the iTunes window. Select one item then hold down the shift key and select the another item.
    Show Duplicates will show both. iTunes doesn't know one from the other. No program does as far as I know. The Show Dups will show the dups - you have to decide which one is a dup. iTunes is showing you the tunes with the same names - the bit rate, kind, etc maybe different - you will need to decide which one to delete or rename.
    MJ

  • Finder show items in columns an item arrangement selected: Right size this column doesn't works

    like the title says, under these condition (note that an item arrangement must be selected) the “right sized” to the maximum width, necessary to display the longest item in the column, doesn't works even with a double click or choosing "Right size this column" option (in both cases the column is set to the default size).
    Anyone else experience this issue?

    You understand me well, sorry I'm not native English.
    Have you selected an item arrangement? if I select "None" it works for me too, the issue is when I select an item arrangement (arrange by Kind for example).
    My setting:
    Finder > View > Show View Options:
    - Always open in column views: SELECTED
    - Browse in column view: SELECTED
    - Arrange By: Kind
    - Sort By: Name
    - Text size: 12
    - the "three show" SELECTED
    Under the above conditions I've the issue, the column isn't resized.

  • How can we select more than one item from LOV in Query_Find form?

    Hi,
    I have a requirement i.e i want to select more than one customer number seperated by comma from the customer number lov field in the query_find form.How can we write the code for this requirement?
    and after clicking find it has to display notification form which contains the details of customer which you selected from Custome query_find form.
    Could you please help me out.
    Thanks in Advance,
    Dhana

    Found the "Search Entire Library" option - click on the small (VERY small for my eyesight) down arrow next to the magnifying glass. Also need to select "Filter by: Songs", and then the songs in the main window show the results.
    I'm going to leave this up on the board because 1) in case someone else has this question, and 2) I don't know how to delete it anyway.

  • Apple Menu: "Recent Items" doesn't work proper anymore

    Hi,
    i switched from 10.5.8 to 10.6.4 and recognized that the "recent items" in the Apple Menu doesn't work proper anymore.
    While OS X is running everything works fine. When i restart the computer all recent items are cleared.
    I want it to behave like it did in 10.5.8, that all recent items where displayed even after a restart.
    I recognized that the "open recent" command in applications like TextEdit or Preview behave the same. While the Program is running everything works fine . If I close and restart the app, open recent is cleared.
    I tried do adjust it under Appearance in the System Preferences, but if i set all Numbers of recent items to "none" for example and restart the computer it will be set for each (Application, Document, Server) back to 10 again.
    Hope someone can tell me a solution because i use "open/ recent Items" alot and it really disturbes my workflow.
    Greetz
    Djordji
    p.s.: I did a quick forum search and did not find any topic about it.
    Message was edited by: SPUMD

    Hi Andy,
    thanks..i checked the preferences for the com.apple.recentitems.plist and didn't find one.
    It seems like the system doesn't write down which items i loaded. I trashed this .plist earlier because i
    saw that hint somewhere else.
    i did like you said and created a new user account, tested different apps and documents, restarded and everything was displayed proper in the "recent items" Appel menu and in the "open recent" of every App.
    I searched in the test account for the com.apple.recentitems.plist, copied it to the preferences of my account and restarted the computer. In the "recent items" displayed the Items that i used with the test account but after several tests it is clear that the system doesn't write down the recent items when i open my account. The com.apple.recentitems.plist still showes only the items i used with the Test account and the info of the file says that it wasn't touched sinced i copied it from the test to my account.
    The Terminal command didn't change anything. The question is why doesn't the system write down wich items and documents i used when i'm in my account?
    Greetz
    Djordji
    Message was edited by: SPUMD

  • New Plug-in item doesn't work as cascading lov

    I have just finished creating a new plug-in that is a searchable select list. I want the LOVs to be cascading. In other words if I have another item on the page I want to be able to specify in my plugin item that the parent LOV is that item. How do I make it work with the cascading LOVs. I am guessing that I have to add some code to my render function but I have no clue what and there are no examples of how to do this. I did find the following in the api documentation but I am not sure how to use it or whether it is what I am looking for
    apex.widget.initPageItem
    Here is a link to an example of my new plugin. There are 2 items on the page. Z is set to have X as its cascading LOV parent but it doesn't work and would like to know how to make it work. You can also download my plug-in from this page and try it yourself.
    http://apex.oracle.com/pls/apex/f?p=32395:3

    Hi,
    the "apex.widget.initPageItem" will not help you in your case, it's used to register callbacks for $s, $v, show, hide, ... if you have a more advanced item type. You can have a look at the "Star Rating" plug-in which implements several of these callbacks.
    For adding cascading LOV support, please have a look at our own select list implementation in /i/javascript/uncompressed/apex_widget_4_0.js
    Search for
    apex.widget.selectList = function(pSelector, pOptions) {to get a blue print implementation for all the steps you have to add to your widget to add cascading LOV support.
    If you need further help, please let me know.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Command-Tab App Switcher doesn't work (related to corrupt .plist file error?)

    Hi folks,
    The other day, Drive Genius 4 reported on a file corruption:  ~/Library/Preferences/System Mac.plist file. I tried to find the file but it didn't appear to exist.
    Today, a strange phenomenon occurred which I think may be related. Strangest thing. I was using Safari, had several tabs open when, suddenly, I lost all input to any links in Safari and system wide as well, other than the cursor being able to move around the display. This dysfunction also included the Command-Tab App Switcher, though they keyboard text function still worked. I could enter text in fields.
    I tried Force Quit Apps but I had to shutdown and reboot using the Power button. The reboot seemed to remedy the situation and most controls and keyboard functions returned except for the Command-Tab App Switcher.
    In Safari, I used History/Restore Last Open Page, and when the searched for pages came up, they were blank - I was informed that there was no internet connection. Wi-Fi showed still on but grayed out, which could be logical. Also, this is when I noticed that the key repeat function wasn’t working. In System Prefs, I did manage to change the key repeat rate, which accelerates the backspace erase function but there is no key repeat, itself.
    All of this, of course, might be pointing to that system file error. Whether it is that hidden Mac.plist file corruption I don’t know.
    In any event, first thing I did was to run Permissions Repair. At one point, about 2/3rds of the way in, the progress bar hung for a few minutes and then finished the last third in a split second. In the Repair Permissions log there was no /Mac.plist file among those repaired.
    Additionally in Sys Prefs, I tested for Tab key response by refocusing the radio buttons in the Full Keyboard Access option under Keyboard/Shortcuts panel from "Text boxes and lists only" to "All controls.” The refocus worked because now pressing Tab does move the cursor through every control. But still no Command-Tab App Switcher. In Spotlight, I did find the App Switcher.app but it would not open, because it is “Damaged or Missing.” App Switcher preferences are  also not accessible.
    In Terminal I changed directories and do see the /Mac.plist file under discussion. I suppose I could -rm the file but I’m reluctant without knowing more about what other anomalies might result. The App Switcher is one of the Mac’s best utilities (thanks to er, Microsoft.) If the /Mac.plist file will refresh from the current status, no problem, I would think.
    Has anyone experienced anything like this? Any suggestions? Thanks a whole lot in advance for your time and consideration in this!
    All best,
    David

    First, get rid of the worthless, time-wasting "Drive Genius" according to its developer's instructions. Never install any so-called "utility" again.
    Don't waste time repairing permissions again, either, unless you have an indication of a permission error involving system files, which you don't and probably never will.
    Never delete any file in the shell (Terminal) for any reason.
    There is no built-in application called "App Switcher." There is no built-in file named "System Mac.plist" either.
    If command-tab application switching still doesn't work after you get rid of "Drive Genius," see below.
    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your documents or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this behavior; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Please take this step regardless of the results of Step 1.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of Steps 1 and 2.

  • Two Oracle databases on one AIX Server - Note working, Pls Help

    Dear Friends,
    I have installed Two SAP systems with Two Oracle Databases on one AIX machine, The Installation of both the systems went fine without any errors, and also i have been able to login to both the systems seperately. (that means i cant start both the systems at a time, its one at a time)
    But the problem is of the Oracle Listener, i am not able to start both the systems with single Oracle Listener processes(tnslistener). I tried all the possible scenarios as mentioned in note 98252 but nothing seems to be of any use so far.
    the thing is i can start either one of the SAP Systems, But my objective is to start both the SAP Systems with one listener processes (LISTENER) and one listener port (1527)
    Or
    you can say i am also ready to keep two different listeners for TWO seperate Oracle databases, I tried doing so as per one of the sap notes in which you have to keep different names of listener and different numbers for listener port for second ORACLE database. I tried doing exactly mentioned in the note but yet unsuccessful...
    Now i am completely lost as what is to be done since its critical i want you to immediately look into it and suggest me the appropriate solution so that i can set up both of my DEVELOPMENT and QUALITY system running...
    To troubleshoot this if you require anything from my side then please feel free to ask me since our functional consultants have to soon start working on the SAP systems.
    Regards
    Ayush

    The note you specified talk about 2 database instances not 2 databases... (I was starting to wonder how you deploy 2 databases), you can have multiple database instances on a DB. The note also give you detailed explanation of the configuration of listener.ora
    Now, if this is the case and you have installed 2 instances (not databases) on the same host and configured the listener according to the note, then you should be able to call R3trans -d from both SID's.. if the R3trans fails please post the contents of trans.log here.
    the thing is i can start either one of the SAP Systems, But my objective is to start both the SAP Systems with one listener processes (LISTENER) and one listener port (1527)
    Then, the configuration of your listener.ora file must be incorrect.
    Regards
    Juan

  • SOCO function "Complete Item" doesn't work

    Helo.
    Please help to solve a problem.
    We have SRM 5.5
    We want to remove positions from SOCO through function "Complete Item".
    But at logon under the Ukrainian language function doesn't work. At logon under English language function in SOCO works.
    How can it be? And why?

    Hi,
    either you need to install the Ukrainian language completely (including supplementation) or if you plan to use the translation workbench for mass translation, you need to translate the texts included in the application you use.
    Please note: If you plan to use Translation Workbench (SE63) for mass translation, supplementation in that system should be avoided (see e.g. SAP Note 353852) !
    Best regards,
    Nils Buerckel

Maybe you are looking for