How to use a calculated column in the same query

Hi All,
I need some help with using a calculated column in the same query.
For eq
I am joining a couple of tables and some of the select columns are calculated based on the columns of the tables and i want a new column in the same query to use this calculated feild in some other calcualtion.
something like this...
select (12+3) as Sum1, (12-3) as Sum2, (Sum1 + Sum2 ) as Sum3
from dual
or
select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( "Sum1" / "Sum2" * 100 > 0 ) THEN 'Yes' ELSE 'No' END
from dual
Thanks

user548171 wrote:
select (12+3) as Sum1, (12-3) as Sum2, (Sum1 + Sum2 ) as Sum3
from dual
or
select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( "Sum1" / "Sum2" * 100 > 0 ) THEN 'Yes' ELSE 'No' END
from dual
ThanksWhat about just repeating the column values:
select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( (12+3) / (12-3)  * 100  > 0 )  THEN 'Yes' ELSE 'No'  END FROM DUAL

Similar Messages

  • How to use a Formula Column in the main query?

    Hi All,
    I've tried to use a formula columns defined in some query in the condition of that query like this:
    where (:cf_ex - :cf_ex2) >= 5
    but when I run the report no data returned! Why? and how to use it the condition of the query?
    Note: I'm using Forms 6i

    where (:cf_ex - :cf_ex2) >= 5You cannot do that. Formula columns are not part of the select statement (which runs in the database), but are processed in the report.
    When you created this query, my guess is that you got the message "Note: the query Q1 has created the bind parameter(s) cf_ex, cf_ex2". Check these User Parameters in your data model. So, you are actually referencing user parameters in the query, not formula columns.
    I made a computations and things using PL/SQL that can't be done in the select statement in the data model!If it's pl/sql you can probably use that in your query. Create some database functions for cf_ex and cf_ex2 and use these in your query.

  • How to use one report column into the another report in obiee

    How to use one report column into the another report in obiee

    i dont want to use column as a filter for another report it should be report column for another report
    Thanks,
    Vivek

  • How to use 10 touch points at the same time ?

    I want to project game which use about 10 touch points? How can I use all of them at the same time ?
    Please give me a sample code.

    Firstly you must know how many touch points can accept your device. For example iPad and iPhone can't handle more than 5.
    1. Enable touch input mode by
    Multitouch.inputMode=MultitouchInputMode.TOUCH_POINT;
    2. Use same method as for mouse input but instead use TouchEvent API

  • How to use ActionListener and ItemListener in the same class

    Why can't I use both ActionListener and ItemListener in the same Class?
    I want to use a drop down list and an entry box on the same form.
    How? I'm having trouble compling......
    Thanks!
    CODE:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Disp extends Applet implements ActionListener, ItemListener
    { TextField entry=new TextField(7);
    Button Enter=new Button("Enter");
    public void init()
    add(entry);
    add(Enter);
    entry.addActionListener(this);
    entry.requestFocus();
    Enter.addActionListener(this);
    public void actionPerformed(ActionEvent thisEvent)
    String answer=entry.getText();

    Simply get your Applet to implement both ActionListener and ItemListener.
    public class MyApplet extends Applet implements ActionListener, ItemListener
      public void init()
        itemWidget.addItemListener(this):
        actionWidget.addActionListener(this);
      public void actionPerformed(ActionEvent e)
        System.out.println("ACTION PERFORMED!");
      public void itemStateChanged(ItemEvent e)
        System.out.println("ITEM STATE CHANGED!");
    }Hope this helps.

  • How to use 2 midi controllers at the same time?

    Hi all,
    I have an Oxy 8 usb keyboard and an old Roland drum machine hooked up through the mid in on my Firebox. Right now they control the same track (in Logic 7 Express) but i would like to use them to input midi to different track simultaneously. Would someone be kind enough to point me to the right page in the manual or, if it's not to much trouble, clue me in on how to do this?
    Thanks for your time,

    Sorry for the double post....
    I really don't remember which model is the Roland 505: for sure I know the Roland and Boss drums series.
    In my life I've had only one (maybe 2 but I remember only one) drum machine and it was a Sequential Drumtrak: it's dynamic was HUGE!
    Now I enjoy the iDrum, the Reason' ReDrum (it's very similar in concept to the Sequential).
    I find the interface of my new Ultrabeat (yes I'm on Studio, now) very ugly and the Ableton Live Impulse little useful.....
    I have again a very old Yamaha SY77 synthesizer and some of its sounds are good for today music but I prefer VI: they are lighter, more flexible and stay in tune (if you want!).
    So enjoy your TR until it's good for you!
    cheers
    rob

  • How to use two different versions of the same jar within one project

    Hi everybody!
    I have a big problem while integrating different web service clients within one bigger java project. Both implemetations need some jar files to work but demand different version. So, i would like to know if there is any way to tell which implementation should use which version! Anyhow i add those jars to the classpath makes working only one or the other webservice working but never both! Any ideas somebody?
    Best regrads,
    Stefan G�tz

    Of course do have the jar files different names but the classes inside of them are the same ... means that the standard system classloader can distinguish them. When you add a jar to a classpath the name actually dosent matter.... any other ideas, please?
    PD.: i tryed to add a manifest file to the one jar which makes use of one of the dublicated jars to specify which jar to take direcly but it makes no difference since once classes loaded they cant be distinguish ....see:
    http://java.sun.com/docs/books/tutorial/ext/basics/load.html

  • How to use Java Robot to click the same button multiple times

    Hi All,
    I am trying to use Java Robot to turn a Windows utility located on the Desktop by clicking the same button on and then off with the following code:
      1.  Robot robot1 = new Robot();
      2.  robot1.mouseMove(400,180);
        // Turn on the utility
      3.  robot1.delay(100);
      4.  robot1.mousePress(InputEvent.BUTTON1_MASK);
      5.  robot1.delay(100);
      6.  robot1.mouseRelease(InputEvent.BUTTON1_MASK);
        //Wait for 2 minutes
      7.  robot1.delay(200);
        // Move the mouse to disconnect button
      8.  robot1.mouseMove(400,180);
        // Turn off the utility
      9.  robot1.mousePress(InputEvent.BUTTON1_MASK);
    10. robot.delay(100);
    11. robot.mouseRelease(InputEvent.BUTTON1_MASK);However, only the first click (line 1 - 7) worked. Everything from step 8 onwards doesn't appear to be doing anything. Even instantiating another robot2 to carry out step 8 - 11 did not work either. Also have tried running steps 9 - 11 only. ie skip 8.
    My aim is to turn this tool on and off at regular interval.
    Any assistance would be greatly appreciated.
    Thanks in advance,
    Jack

    Hi darth_code_r and Vincent,
    Both you and Vincent are right about insufficient time between the release ( 6 ) of mouse button and step ( 9 ) press the same button again to turn it off. You are also correct in saying that it was not necessary to move the mouse again ( 8 ) since it was sitting on the right button already.
    Below is the code I have ended up with which worked for me:
    1.  Robot robot1 = new Robot();
    2.  robot1.mouseMove(390,150);
    4.  robot1.mousePress(InputEvent.BUTTON1_MASK);
    6.  robot1.mouseRelease(InputEvent.BUTTON1_MASK);
         //Wait for 3 minutes
    7.  robot1.delay(30000);
    9.  robot1.mousePress(InputEvent.BUTTON1_MASK);
    11. robot1.mouseRelease(InputEvent.BUTTON1_MASK);This utility also takes a few seconds to turn itself on and vice versa. As a result, it is necessary to give it sufficient time to turn on prior to turning it off again with the second mouse press.
    Thanks to both of you very much,
    Jack

  • Satellite M30X-122: How to use headphone and speaker at the same time?

    Hi,
    is there any possiblity to use the headphone and the speaker at the same time?
    When I plug the head phones in the socket, the speaker is swtiched off now.
    Thanks
    Peter

    Hi Peter,
    Unfortunately there is no way to use both the headphones and the speakers at the same time. This is because tghere is as physical disconnection of the current to the internal speakers when you plug in the headphones. It is not software controlled. The only way of bypassing this would be to dismantle the headphone socket and permanently solder the connections which are broken when you insert the headphone socket.
    regards,

  • Help please:    Newbie.   Just downloaded AE CC 2014.   How to use a camera while at the same time "previewing" a scene?

    When trying to preview a composition in 3d (like you see when people are doing tutorial videos), whenever I click on the preview  (whilst attempting to move the camera around in the scene to preview it), the preview stops  (due to clicking the mouse button).   
    In other words, I cannot play back a preview and manipulate the camera at the same time.   Again, in most tutorials I see online the "teacher" is manipulating the camera while also previewing the scene they are discussing.     I can't do this as every time I click the mouse to manipulate the camera, the preview stops due to the mouse click. 

    Hi Dave...
    I think I may be losing my mind....here it is 2am in the morning.   :  )     
    Your post made me double check what I was looking at, and I think I was wrong.    I was watching a Trapcode Particular video tutorial and perhaps all of the 3D particles in the scene gave me vertigo!    In any event, I think this case can be closed as quickly as it was opened. 
    Cheers

  • Using lag and rank in the same query

    Hi
    I am trying to find out the difference in time between peoples memberships and also the order that these memberships are taken out in. So far I have added in a rank statement to work out the order the memberships were created in, but now want to look at the difference between the dates returned. The SQL I used is:
    SELECT owner_party_id,
    mem_number,
    support_id,
    mem_start_date,
    RANK() OVER (PARTITION BY owner_party_id ORDER BY mem_start_date ASC) MEMBERSHIP_SEQUENCE
    FROM membership_all
    WHERE version_type = 'CUR'
    AND owner_party_id IN ('65051', '65051', '65348', '65348', '65607', '65607', '65607')
    to get:
    "OWNER_PARTY_ID"|"MEM_NUMBER"|"SUPPORT_ID"|"MEM_START_DATE"|"MEMBERSHIP_SEQUENCE"
    65051|318874751|8014747|01-MAR-10|1
    65051|412311060|21502883|15-AUG-12|2
    65348|308672459|3526913|01-MAY-10|1
    65348|409951130|20950524|18-JUN-12|2
    65607|315830192|7510133|17-MAY-10|1
    65607|406448110|20024246|16-MAR-12|2
    65607|409738130|20903556|14-JUN-12|3
    Now I would like to calculate the difference between the start dates of each of the owner_party_id groups, so to get something like this:
    OWNER_PARTY_ID|MEM_NUMBER     |SUPPORT_ID|MEM_START_DATE     |MEMBERSHIP_SEQUENCE|Diff
    65051|318874751|8014747|01-Mar-10|1|     
    65051|412311060|21502883|15-Aug-12|2|898
    65348|308672459|3526913|01-May-10|1     
    65348|409951130|20950524|18-Jun-12|2|779
    65607|315830192|7510133|17-May-10|1     
    65607|406448110|20024246|16-Mar-12|2|669
    65607|409738130|20903556|14-Jun-12|3|90
    I think that I need to use the Lag function in, but I am not too sure if it can be linkited to look at the data within a grouping of owner party id, as it would make no sense to calculate the difference in dates for two different owner party ids.
    Any advice much appreciated.
    Thanks
    Edited by: 992871 on 09-Mar-2013 23:34

    Couple notes:
    1. You wrote you want to get order that these memberships are taken out in, however, both your and Etbin's queries calculate order within each owner_party_id and not across all members. If you want to get rank and difference in time regardless of member's owner_party_id remove PARTITION BY caluse.
    2. You might want to use DENSE_RANK and not RANK depending how you want to display rank. If two people joined at the same time and were second in rank, analytic RANK will be:
    RANK
    1
    2
    2
    4
    5
    .while DENSE_RANK:
    DENSE_RANK
    1
    2
    2
    3
    4
    .SY.

  • How to use Spry and Jquery on the same page.

    I'm using both spry (dataset) and jquery (datepicker) on my page. When I load the jquery script my dataset doesn't work.
    I've done some research and found that I need to insert an observer that tells jquery when the spry dataset is finished loading. Found this information at: http://forums.adobe.com/message/2899897. I've tried implementing this into my script but just doesn't seem to work. Below is the script from my site, how would I insert an observer into this script?
    <script type="text/javascript">
    <!--
    var ds1 = new Spry.Data.HTMLDataSet("/test/fsasearch_results_dynamic.php", "search_results");
    var ds2 = new Spry.Data.HTMLDataSet("/test/countstable_dynamic.php", "table");
    $(function() { $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd', beforeShowDay: nonWorkingDates, numberOfMonths: 2, minDate: +5, maxDate: +30});
        function nonWorkingDates(date){
            var day = date.getDay(), Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6;
            var closedDates = [[7, 29, 2009], [8, 25, 2010]];
            var closedDays = [[Saturday], [Sunday]];
            for (var i = 0; i < closedDays.length; i++) {
                if (day == closedDays[i][0]) {
                    return [false];
            for (i = 0; i < closedDates.length; i++) {
                if (date.getMonth() == closedDates[i][0] - 1 &&
                date.getDate() == closedDates[i][1] &&
                date.getFullYear() == closedDates[i][2]) {
                    return [false];
            return [true];
    //-->
    </script>

    Please post any SPRY related question in the SPRY forum.

  • How to use two "field separator" in the same Comunication Channel

    Hi experts,
    I  upload flat files with XI, and my Comunication Channel is configured to use the field separator "~".
    FILA.fieldSeparator     ~
    Is posible to configure that Comunication Channel to accept two field separator. I want that upload flat files that has as separator "~" and flat files that has "|" .
    thanks
    regards

    IT IS not possible to have 2 fieldseparator to identify the fields of a record.

  • How to use different font styles in the same boolean text?

    Hi all,
    As reported here http://digital.ni.com/public.nsf/allkb/6BD344ACA4DEE20A8625692700737E16, it is possible to change font color, size or other font properties of a subtext in a string indicator. This can be applied to a caption too.
    I'd like to apply this properties to a boolean text but it does not work. The boolean control has the Text.selectionStart and End property node but it does not appear to function.
    Can you help me?
    Thanks all

    This is a bug in the development environment (I think it showed up around LV8).
    There's a workaround, but it seems to work intermittently: Place some floating text on your front panel, then edit it's font styles.  Select and copy the floating text.  Select the boolean text (double click on it).  Paste.

  • How to create Remainder email workflow in share point 2010 designer without creating the remainder date (calculated) column in the list

    Hi,<o:p></o:p>
    I have task to create remainder email notification 3 days before by comparing with End
    date (my list item) so i created one calculated column in the list as remainder date by using that remainder date
    i created, but my project manager told me create same remainder notification work flow without create that remainder date i tried to write calculation in work flow
    but it is not working if any one knows how to do this please help me<o:p></o:p>
    Thanking you,<o:p></o:p>
    ArunDarly <o:p></o:p>

    Hi,
    For reminder type requirements, I tend to use the ‘Information Management Policy’ SPD method as described in
    this blog article by Laura Rogers (it’s for MOSS and WSS but works in SP2010 also).
    This method avoids the use of calculated columns; rather the workflow does the calculation and outputs information into a ‘reminder’ field. Also, I don’t like the idea of ‘paused workflows’, so this method works for me.
    Cheers
    Matt

Maybe you are looking for

  • Publishing reports using BEx to the Portal

    We have a folder called Store_Data (under Public Documents in KM) that has 500 store folders for reports.  They are sorted by store number.  When publishing reports to those folders from BEx Broadcaster the folders are sorted by creation date which m

  • Iphoto on ipad no longer sees my photostream since IOS 7 upgrade

    iPhoto on my ipad no longer sees my photostream in the albums page of the iPhoto app since IOS 7 upgrade?? I can see my photostream and shared photostreams in the ordinary Apple photo app on the iPad. Prior to IOS 7, all these photostreams were visib

  • 945GCM5-F V2: memory problems/queries

    EDIT: I've got a problem with Windows Vista Ultimate SP2 x64 look... CCleaner says I have 4GB.... CPU-Z says I have 4GB... p.s. BIOS Says that I have 3072MB.....! On POST and on BIOS -> System Information.... What can I do for this

  • Progressbar.fmb, pjc, 6i forms

    Developing on a 6i C/S enviroment. Windows 2000 Converting to a 6i web, then 9i web enviroment. Hp Unix I'm trying to use (for the first-time ever) a pjc to mimic the "spinning wheels" while a report status is being checked. I found reference to the

  • Composite/Interactive Models and ERP 2005 SP05

    We have downloaded the Composite/Interactive models developed for the MIC application.  These allow direct input into the model by the user to update the ratings, report issues, and update the sign-off status.  These models are based on a series of B