How to write request for that given information?

I have table (employees) like this

Hire_date Salary
4 January 19912000
05-mar-19911300
12 sep-19912400
February 19, 19923000
17 Apr-19921000
November 23, 19921200
January 25, 19931000
June 6, 19931200

I want to get an output like this

Hire_date Salary Years in the range total
4 January 19912000
05-mar-19911300
12 sep-199124001 January 1991 to 31-dec-19915700
February 19, 19923000
17 Apr-19921000
November 23, 199212001 January 1992 to 31-dec-19924200
January 25, 19931000
January 6, 199312001 January 1993 to 31-dec-19932200

Give me a few ideas guys

Hey Gopi,

This is the final query.

SELECT res.employee_id

res.salary

decode(res.rnum,1,res.total_sal)

decode(res.rnum,1,res.years_in_range)

FROM (select e.employee_id

e.salary

, TRUNC (hire_date, 'YYYY'): ' to ' | (add_months (TRUNC (hire_date, 'YYYY'), 11) + 30) years_in_range

Salary on (partition of to_char (e.hire_date, 'YYYY')) total_sal

row_number() on rnum (partition by to_char (e.hire_date, 'YYYY') order by ASC e.salary)

e employees) res

See you soon,.

Suri ;-)

Tags: Database

Similar Questions

  • How to write a program that allows an HTTPs connection to the APACHE TOMCAT server in blackberry JDE

    Hello.. I am very new to the blackberry JDE environment. But then, I have a project in which I should write a program that will make an HTTPs connection to the apache tomcat server using blackberry JDE. The simulator which I use is 8330-JDE.

    Here is my code...

    import java.io.IOException;

    Import java.io.InputStream;

    Import javax.microedition.io.Connector;

    Import javax.microedition.io.HttpsConnection;

    Import net.rim.device.api.ui.UiApplication;

    Import net.rim.device.api.ui.container.MainScreen;

    public class Httproto extends UiApplication

    {

    public public static void main (String [] args)

    {

    Httproto instance = new Httproto();

    instance.enterEventDispatcher ();

    }

    public Httproto()

    {

    pushScreen (new HttpsConnectionScreen());

    }

    }

    final class HttpsConnectionScreen extends screen

    {

    public HttpsConnectionScreen()

    {

    HttpsConnection c = null;

    InputStream is = null;

    int rc;

    try {String url =

    "https://192.168.2.3: 8443/cit/j_acegi_security_check? j_username = sanogo & j_password = redhat;

    c = (HttpsConnection) Connector.open (url);

    c.setRequestMethod (HttpsConnection.POST);

    System.out.println ("connection is open with the server");

    Get the response code is open the connection,

    Send the request and read HTTP response headers.

    The headers are stored until asked.

    RC = c.getResponseCode ();

    System.out.println ("response from the server" + rc);

    if (rc! = HttpsConnection.HTTP_OK) {

    throw new IOException ("HTTP response code:" + rc);

    }

    is = c.openInputStream ();

    Get the ContentType

    The string of type = c.getType ();

    The length and process data

    int len = (int) c.getLength ();

    if (len > 0) {

    int actual = 0;

    int BytesRead = 0;

    byte data = new byte[len]; while ((bytesread! = len) & (real! = - 1)) {

    real = is.read (data, bytesread, len - bytesread);

    bytesRead += real;

    }

    } else {}

    int ch;

    while ((ch = is.read (())! = - 1). {

    }

    }

    } catch (ClassCastException e) { throw new IllegalArgumentException ("not a HTTP URL");}

    }

    catch (IOException ioe) {}

    finally {

    Try

    {

    if (is! = null)

    is. Close();

    if (c! = null)

    c.Close ();

    }

    catch (IOException ioe) {}

    }

    }

    }

    When I run this program in the Simulator, I can do nothing. Please correct me if I'm wrong in coding.

    As I am new to this blackberry JDE environment, ideas and suggestions on how to write and run the sample applications in the blackberry are more welcomed.

    Concerning

    Hinduja

    Make sure that your MDS starts when the Simulator starts.  In the JDE will in Edition > Preferences > Simulator > General and click the checkbox "launch Mobile Data System connection with Simulator Service.

  • How to write VBA code that is compatible DEP

    Hello

    We have a number of VBA macros, Excel. Some users report an error

    After some research, I believe that it is related to the Microsoft Data execution prevention feature. I presume our adds that something that does not like the DEP. Is there a guide on how to write/re-write macros to avoid problems with DEP?

    Thank you

    Emmet

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.technet.Microsoft.com/forums/en-us/home

    http://social.msdn.Microsoft.com/forums/en-us/home

  • How to separate requests for authentication to GBA 4.2

    Hello

    I have a 4.2 ACS for AAA. Right now I use this server to authenticate users this connection for all my devices cisco (routers, switches, ASAs, APs) and also to authenticate users for remote access VPN to ASA.

    The problem I have is that VPN users residing on another group in ACS are able to authenticate to log to manage network devices and it is a problem of security. I need the vpn users only being able to authenticate to the vpn and not be able to authenticate to connect to network devices.

    Any ideas? is it possible to separate requests for access radius and vpn connection?

    Hi Fernando,

    Yes it is possible to restrict your users only VPN to VPN - ASA. If you want that they do not have telnet/ssh/http access with other devices in the network, then you can go for NAR (network access restriction).

    The only thing you need to know what we are calling-station-id. I think it's an ip address. You can check this activity and reports > past authentication for VPN users.

    Here are the steps:

    GBA > go to the VPN group > Edit > search for NAR > under Ip based NAR > set the action to "DECLINED" > select the devices (routers/switches) you want to deny access to > put * for the port field and address > click on submit + restart.

    Doing this will of users can connect through vpn and unable to do ssh and telnet.

    I have attached the screenshot of the same thing (I did for 6509 switch)

    HTH

    JK

    Please evaluate the useful messages-

  • Request for pointers to information on the licence fees for ADF + Weblogic

    We are building an ADF application into a habit techstack ADF Application - Oracle Weblogic, Oracle DB + UCM(Webcenter Content) Techstack + ADF and need clarification on license fees. My understanding is that when we have a license for Weblogic, we reach the ADF with her. My understanding is correct? If so, it holds true for 12 c as well? I checked http://www.oracle.com/us/corporate/pricing/price-lists/index.html and I could see pricing for each of them but could not get clarity if I'd get ADF with Weblogic. I tried a cat live from oracle.com with the sales team, it did not help much either.


    If you looking for pointers to information.


    Also, license fees vary in all of the versions (of ADF, Weblogic, DB, Webcenter content) or domain for which we build our product/solution?

    Don't we have special discounts for Gold partners or so?

    We are in the assessment phase and this information is essential for us in the decision-making process to our tech stack and would be great if I could get in contact with someone from the team of sales or licenses from Oracle team.

    Thank you

    Sery

    (Timo, I led Sanchez to post here instead of my personal e-mail)

    Sankar, as long that you bought a stand-alone license for WLS, you have a license for the ADF as he presents himself as a free add-on.  However if you purchased WLS jointly with the Complutense University of MADRID or other products of Oracle hosted the WLS, you should check your licenses to see if there are restrictions in the use of WLS.  In this regard, Timo is correct, you should contact your Oracle sales representative to find out which is correct in this regard.

    CM.

  • 'main' arguments when starting program - how does communicate requests for file to Windows programs?

    Someone know what Windows up or sends to a program when it is first started? I don't know yet what to look under. In particular, if I double click on a document (say a data file that I generated with my LabWindows/CVI program) and I have my default program for this file under Windows, how is my program knows it when it starts? (I.e. a double-click on a Word document starts Word and opens this document.) In addition, what happens if my program is already running? No doubt, Windows sends a message to the programs telling them that the user has requested to open a file of the appropriate type.

    Windows passes the name of the file you clicked on the application as a command line parameter: the attached program lists simply all the command line arguments received in order to check how it works. I did a few tests by creating a '. '. XYZ"file and then associate this program with it. Then, I created a new operation 'Print', defined in this way:

    and received the correct settings, I simply double click on the file and when I click right on it and choose 'print '.

    (Note: argv [0] is always the name of the program itself: command line options, if any, starts at index 1).

    I can't say anything about your second question: I know that the CVI has a way to see if another instance of the application is running (see the CheckForDuplicateAppInstance command in the utility library), but I don't know how it is implemented.

  • How to eliminate requests for password Keychain with a log in

    Whenever I connect to Macbook Air multiple popups request password to keychain for different public services. How can I stop this from happening?

    Reset your keychain

    Keychain Access > Preferences > reset my default Keychain

  • How to ignore requests for password when creating the DB with the DBCA shel scripts

    When generate a database with scripts automatically passwords DBCA asks 1 2 times at the beginning and 1 initializing ora.ini DB.

    I should replace the lines as
    Connect "SYS" / "' & & sysPassword ' as SYSDBA"
    with the password that is real because it's a public password to test databases.

    P. S.
    If these questions are not apropriate and a burden for the cmmunity you can inform me.
    Up to now, if I can't find something on common search keywords, I add it, believing it to be a contribution to the knowledge base of the Oracle communities

    I found the solution. As MarkDPowell has pointed out, invited because ACCEPT input so have to comment on it.

    And I can pass my own password public as a variable to SET - http://docs.oracle.com/cd/B10501_01/server.920/a90842/ch13.htm#1008884

    P. S.

    I'm trying not to let the non-answered son.

  • How to create a form that adds information to a list on the site of the muse?

    Hello

    I need to create a form for my site of muse. When the form is submitted the information needs to go to a table or database or the list on this site of muse.

    For example, a customer would go on my site and do not want to publish information on what they are looking for. They fill in their details and what they are after and click on submit. Such information would then appear in a list or a table containing information of other customers who submitted information.

    Is this possible? Is it possible to do in Affairs Cataylst? Any assistance or other means would be appreciated.

    CN

    Hello

    Yes it is possible with BC. You can either use the form of Muse or create a form in British Colombia, and then insert the form html code in the Page of Muse.

    Once the user submits the form, a notification would be triggered for you that would show the summary form as what the user has filled in the details.

    In CRM, submitting a form creates an action in respect of the user entity. You can access the case and see related information. In BC CRM, you can directly access all cases and use the filter options to filter with date etc. Alternatively, you can generate a report on the use of the form or the case where he would list details of the user and the field values that the user has submitted.

    Please note, published Muse site are web hosting sites, which does not include the feature of CRM/CMS in order to get the CRM, you must upgrade the site which is the plan of site different from those you get with your subscription to the CC.

    http://www.BusinessCatalyst.com/features/CRM-database

    http://helpx.Adobe.com/business-catalyst/SBO/customer-database.html

    http://helpx.Adobe.com/business-catalyst/SBO/building-customer-report.html

    In addition, I suggest try all features with a place to test first and then, after finalization, you can upgrade to a paid plan.

    Thank you

    Sanjit

  • How to write 'loop' for this block in as3?

    Could Hello everyone, you please help me write a loop for the following code?

    PS: bx1, bx, 2bx3... are clips video, xfir1, xsay1, xad1, xtip1, xdil1 are dynamic text boxes.

    var xmlLoader9:URLLoader = new URLLoader();

    xmlLoader9.addEventListener (Event.COMPLETE, showXML99);

    xmlLoader9.load (new URLRequest ("spops.xml"));

    function showXML99(e:Event):void

    {

    XML.ignoreWhitespace = true;

    var tree: XML = new XML (e.target.data);

    BX1.xfir1.text = fir.sno [0].aa.text ();

    BX1.xsay1.text = fir.sno [0].bb.text ();

    BX1.xad1.text = fir.sno [0].cc.text ();

    BX1.xtip1.text = fir.sno [0].dd.text ();

    BX1.xdil1.text = fir.sno [0].ee.text ();

    BX2.xfir2.text = fir.sno [1].aa.text ();

    BX2.xsay2.text = fir.sno [1].bb.text ();

    BX2. XAD2. Text = fir.sno [1].cc.text ();

    BX2.xtip2.text = fir.sno [1].dd.text ();

    BX2.xdil2.text = fir.sno [1].ee.text ();

    BX3.xfir3.text = fir.sno [2].aa.text ();

    BX3.xsay3.text = fir.sno [2].b.text ();

    BX3.xad3.text = fir.sno [2].cc.text ();

    BX3.xtip3.text = fir.sno [2].dd.text ();

    BX3.xdil3.text = fir.sno [2].ee.text ();

    ...

    ...

    ...

    }

    without seeing the structure xml and lack a lot of details that would provide a better solution, try this:

    Step 1: all the dynamic text boxes in the MC of the same name (for example, because they are different MC, they can all have a child named "xfir")

    var boxes: Array = [bx1, bx2 bx3 bx4]; Add as many as you want

    var xmlLoader9:URLLoader = new URLLoader();

    xmlLoader9.addEventListener (Event.COMPLETE, showXML99);

    xmlLoader9.load (new URLRequest ("spops.xml"));

    function showXML99(e:Event):void

    {

    XML.ignoreWhitespace = true;

    var tree: XML = new XML (e.target.data);

    for (var i: int = 0; i > boxes.length; i ++)

    {

    cells [i].xfir.text = fir.sno [i].aa.text ();

    cells [i].xsay.text = fir.sno [i].bb.text ();

    cells [i].xad.text = fir.sno [i].cc.text ();

    cells [i].xtip.text = fir.sno [i].dd.text ();

    cells [i].xdil.text = fir.sno [i].ee.text ();

    }

    }

  • OfficeJet 6500 A +: how to write bitmap for HP Officejet 6500 a

    On a previous HP laserjet, I used to be able to open up the printer as a file LPT1 and write a bitmap of the screen using MS Basic (Quick Basic) professional development system.  I do something similar on the Officejet 6500 of?

    The OfficeJet 6500 A printer models include only the PCL3GUI Language of Description of Page, so your Basic program must convert your bitmap image into the equivalent object in this language.

    But (as far as I know) HP do not publish this PDLspecifications, so it would be very difficult without the use of a supplied driver.

    There may be features that your basic program can call which would be "hook" in the driver, as well as common applications (Word, Paint, etc.)?

  • I am a newbie to this and I was wondering how to write CSS Code for text, text color, size text and text effects...

    Please keep in mind that I am a newbie. For the moment, I don't know how to write code, so I use Muse to try to build a Web site that is not super fancy writing know, then improve or build or create a new site later. I called Adobe and they said someone in the forums may know how to write code and that he could help me. That said, if someone could answer my questions and help me somehow, I'd be really grateful.

    1. How can I write code, what code should I write to

    Text?

    Color of the text?

    Text size?

    Text/Font Style

    Text effects (such as fly in or fly out, bounce in and out bounce, spin in and spin out, fade in and fade out, etc)?

    Direction of text effect?

    Time that the effect occurs, if it is applied, initiated, comes in? example fly in or fade?

    Time than the last.

    After the effect stops, turns off? example: fly away or fade out?

    2. how to enter the code Muse?

    3. should I have a program to write the code?

    4. is there a function I could use on my computer, such as Notepad, to write the code, copy and paste it into Muse?

    5. What is the best book or books to learn how to write css, code and everything I need to do to be able to do the above and more?

    6. is there anything else I need to know or do to be able to do these things with the text?

    You can find more information on the style of your text (paragraphs, titles, etc. in some of the tutorials here: TUTORIALS |) Adobe Muse CC

    You can also check out tutorials on this page for scrolling effects that can do some of the other effects you need. Without exactly knowing your use case it's hard to give specific advice.

    Basically if it is not covered undressed under the text, scrolling Effects tutorials or in a third party widget already made, then you will need to create it yourself using CSS. You will need to use some sort of browser Firebug like developer tools in Firefox to find the ID of the element you want to add the CSS to write the CSS code and insert it into the head section of the page properties.

  • How to write the function for bottom of logic...

    I have a picture in the picture I have a records like below
    code value
    1 20
    2 null
    3 30
    4 null
    5 40
    6 null


    The output need to have the values displayed in the fields first, followed by the NULL values as below

    code value
    1 20
    2 30
    3 40
    4 null
    5 null
    6 null

    I think the suspicion is that the values must be concatenated with the replacement of NULL values with (;).
    as
    20, 30, 40
    Get single values and insert into the table...

    for this I don't know how to write function for who can please help me on these...

    Published by: Claudia on June 22, 2011 22:45

    Published by: Claudia on June 22, 2011 22:51

    Create or replace function test_fun
    is
    cursor fun1 is the value select from table by CSA 2;-"this select query will return 20,30,40, null, null, null".
    v_out varchar2 (20);
    Start
    fun1 open cursor;
    loop
    extract the fun1 in v_out;
    dbms_output.put_line (v_out); - this is the command display output on the screen.
    output when fun1 not found %;
    end loop;
    close;
    end;

    Please try it and tell us if no query...

    Thank you
    IQ

  • How to write Save function based on the drop-down list box selection data in app mxml flex4 with as3

    Hi all

    I'm working on the application web flex4 with as3.

    I have a doubt, I've created a mxml it has two text boxes, except the button and a combo box that is has two option as a percentage and the amount.

    my needs are I gave here.

    need 1: when I choose option amount that two text boxes does not have to be editable.when I select text tat box two percentage option will be editable.

    need 2: when I select the percentage in combox option and two text boxes are empty, and then click the button Save-> I want to display warning msg

    need 3: when I select the option amount combox and the two boxes are emptu click the button Save-> I don't want any warning messages.

    How to validate it and how to write backup for this function.

    This is my sample code:

    list box ID = baseAmtPer

    ID TextBox1 = maxCommAmt.text

    ID = baseAmtPer.text text box

    If (((baseAmtPer.editable!=true) & & (maxCommAmt.editable! = true)) & & ((baseAmtPer.text=="") & &(ma xCommAmt.text=="")) |) (baseAmtPer.text == "") | (maxCommAmt.Text=="")) -> This condition not allowing while I'm selecing amount in combo box. How the TWO TEXT BOX WILL BE EMPTY for this problem

    {

    Alert.Show ("enter in all areas", "Information");

    }

    on the other

    {

    some encodings

    }

    Hello

    Please go through the following Code:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

    Import mx.collections.ArrayCollection;

    Import mx.controls.Alert;

    Import spark.events.IndexChangeEvent;

    protected function button1_clickHandler(event:MouseEvent):void

    {

    If (comboBox.selectedItem == "Percentage" & textBox1.text == "" & textBox2.text == "") {}

    Alert.Show ("enter the values");

    }

    }

    protected function comboBox_changeHandler(event:IndexChangeEvent):void

    {

    {if(ComboBox.SelectedItem=="Amount")}

    textBox1.editable = false;

    textBox2.editable = false;

    }

    else {if(comboBox.selectedItem=="Percentage")

    textBox1.editable = true;

    textBox2.editable = true;

    }

    }

    ]]>

    Amount

    Percentage

    Thank you and best regards,

    ------------------------------------------------------------------------------------------ --

    Vibhuti Gosavi . [email protected] | www.infocepts.com

    ------------------------------------------------------------------------------------------ --

  • Request for updating the channel

    Hello

    How to write a query that can update below statement

    /Shelf = CORE/slot = Slot0/port = 0

    TO

    /Shelf = 1/slot = 0/port 0 =

    The rule is CORE is replaced by 1 and must removed the chain Slot

    user11432758 wrote:

    Hello

    How to write a query that can update below statement

    /Shelf = CORE/slot = Slot0/port = 0

    TO

    /Shelf = 1/slot = 0/port 0 =

    The rule is CORE is replaced by 1 and must removed the chain Slot

    You need to explain in detail what is your problem. You try to replace a model? If so, you will have to explain this. As for the question you asked a simple REPLACEMENT would do the job

    SQL> with t
      2  as
      3  (
      4  select '/shelf=CORE/slot=Slot0/port=0' str
      5    from dual
      6  )
      7  select str
      8       , replace(replace(str, 'CORE', '1'), 'Slot') str_new
      9    from t;
    
    STR                           STR_NEW
    ----------------------------- -----------------------------
    /shelf=CORE/slot=Slot0/port=0 /shelf=1/slot=0/port=0
    
    SQL>
    

Maybe you are looking for

  • Trying to set the BIOS to boot from CD with Acronis HD clone software

    Want to 700-056.  16 GB of Ram.  Qurdro graphic K600. I just installed a 240 gb SSD, Kingston. To move the operating system (8.1), I need to boot from a DVD with Acronis program. Under the legacy in BIOS, Acronis is displayed.  I move under the legac

  • Error in homegroup

    I'm running a couple of old HP 625 computer laptop and I have had problems with the homegroup. I can not connect to any homegroup, because it tells me that I'm already in one. If I try to leave there is a message "Windows could not remove your form f

  • Context menus for both the left mouse and right-click

    I have a desktop HP Pavilion 500 with Windows 8. Installed in the first week of April 2014. I have a mouse wired HP supplied with my desktop computer. Last week, the two mouse clicks left & right to display the context menu. I did not any changes to

  • Windows Mail is no longer mail

    From: yahoodan Using windows mail for more than a year on the same computer and now I can no longer send emails. I always receive. This is the message I get. Your server suddenly put an end to the connection. The possible causes for this include serv

  • The programs have been modified and open in Windows Media player

    Programs of my laptop will not start because they have been modified to open with windows media player. What should I do?