Need to write a cursor to the following requirement

Dear all.

I have the design of the table as follows

SQL > SELECT * FROM THE Department;

ID_NO DEPARTMENT FROM_DT TO_DT

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

100. IT AUGUST 17, 93 MARCH 31 02

100 BANKS 1 APRIL 02.

SQL > SELECT * FROM DESG.

ID_NO DESIGNATION FROM_DT TO_DT

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

100 INTERNS AUGUST 17, 93 31 OCTOBER 00

DEVELOPER OF 100 1 NOVEMBER 00 31 MARCH 03

HEAD OF TEAM 100 1 APRIL 03 30 JUNE 05

MANAGER OF 100 1 JULY 05.

I need the output voltage

100 TRAINEE COMPUTER AUGUST 17, 93 31 OCTOBER 00

100 DEVELOPER COMPUTER 1 NOVEMBER 00 31 MARCH 02

100 BANKS DEVELOPER ON APRIL 1 02 31 MARCH 03

100 BANKS TEAM LEADER 1 APRIL 03 30 JUNE 05

MANAGER BANKING 100 1 JULY 05-

The problem is that the same person working as a DEVELOPER in IT and BANKING, so I can't get the right output.

I tried this with cursor set, even if I do not have the correct result.

with

Dept as

(select 100 ID_NO, "IT" DEPARTMENT, to_date('17-AUG-93','DD-MON-RR') FROM_DT, to_date('31-MAR-02','DD-MON-RR') TO_DT of all double union

Select 100, 'BANK', to_date (1 April 02 ',' DD-MON-RR'), double null

),

DESG as

(select 100 ID_NO, "INTERN" DESIGNATION, to_date('17-AUG-93','DD-MON-RR') FROM_DT, to_date('31-OCT-00','DD-MON-RR') TO_DT of all the double union)

Select 100,'DEVELOPER',to_date('01-NOV-00','DD-MON-RR'),to_date('31-MAR-03','DD-MON-RR') in all the double union

Select 100, 'TEAM LEADER',to_date('01-APR-03','DD-MON-RR'),to_date('30-JUN-05','DD-MON-RR') union double all the

Select 100, 'MANAGER', to_date (1 July 05 ',' DD-MON-RR'), double null

)

Select x.id_no,

y.Department,

x.DESIGNATION,

Greatest (x.from_dt, y.from_dt) from_dt.

NULLIF (less (nvl (x.to_dt, date ' 9999-12-31'), nvl (y.to_dt, date ' 9999-12-31')), date' 9999-12-31) to_dt

of master's level x,.

y Dept

where x.id_no = y.id_no

and greatest (x.from_dt, y.from_dt)< least(nvl(x.to_dt,date="" '9999-12-31'),nvl(y.to_dt,date="">

order by 4

ID_NO DEPARTMENT DESIGNATION FROM_DT TO_DT
100 HE INTERN 17/08/1993 31/10/2000
100 HE DEVELOPER 01/11/2000 31/03/2002
100 BANKING SERVICES DEVELOPER 04/01/2002 31/03/2003
100 BANKING SERVICES TEAM LEADER 01/04/2003 30/06/2005
100 BANKING SERVICES MANAGER 01/07/2005 -

Concerning

Etbin

Tags: Database

Similar Questions

  • Is - is this legitimate? I get the following requires Windows Genuine Advantage from Microsoft Corporation: Validation status: Action required

    Is - is this legitimate?  I get the following requires Windows Genuine Advantage from Microsoft Corporation: Validation status: Action required
    The validation process cannot continue because your web browser is not configured to run the components required by the genuine validation process. The following will help you solve this problem and continue with validation.

    The information bar is shown below.

    1 1 clic click right on the information bar and select install the ActiveX (see below) control

    2. when the Internet Explorer security warning dialog appears, click on install.

    If the ActiveX control does not properly install, you can click on the button OK below to start the posting process replacement (optimized for browsers unable to perform the initial validation script).
    Is - is this legitimate?  I get the following message claiming to be Windows Genuine Advantage from Microsoft Corporation:
    Validate now state of Validation:

    It is valid only if the message comes from Microsoft.com

    Go to this Web site in Internet Explorer: http://www.microsoft.com/genuine/validate/

  • I have a generator of two impulses. I need to write to a file the three intervals Ao0

    I have a two train pulses a 6009. They are Ao0 Ao1. Ao0 output will produce the total time on my meter. The façade shows 3,1,3. I can run the relay very well. I need to write about my 'Write to file - LVM' the same 3 intervals in time. Write after 3 seconds, the overall data. After 1 second, then after 3 seconds more.

    Thank you

    Philippe

    wrong file

  • How to write a query for the following scenario

    Hi I have a table as follows which have values of column as below
    column1     column2     column3     column4     column5     column6     column7     column8
    10000     10     1     7     15     10     9     0
    10001     11     2     7     19     0     8     1
    10002     12     3     9     8     7     15     0
    I want to find the values 7 and 15 on each line together in one of the columns of 4 to 8.

    Here, in case I get a first and third ranks.

    (Column1, Column2, Column3) is the primary key for the table

    Help, please

    Hena
    with data as
    (
    select 10000 as column1,     10 as column2,     1 as column3,     7 as column4,     15 as column5,     10 as column6,     9 as column7,     0 as column8 from dual union all
    select 10001,     11,     2,     7,     19,     0,     8,     1 from dual union all
    select 10002,     12,     3,     9,     8,     7,     15,     0 from dual
    )
    select * from data
    where 7 in (column4, column5, column6, column7, column8)
    and   15 in (column4, column5, column6, column7, column8)
    /
    COLUMN1                COLUMN2                COLUMN3                COLUMN4                COLUMN5                COLUMN6                COLUMN7                COLUMN8
    ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ----------------------
    10000                  10                     1                      7                      15                     10                     9                      0
    10002                  12                     3                      9                      8                      7                      15                     0                      
    

    Edited because requirement changed while displaying the solution

    Published by: Cyn on October 30, 2009 15:27

  • I would like to know what kind of a configuration server and infratstructure I should opt for the following requirement in my project

    Site managed by a web application with nuke dot net, ASP.Net & c#,.

    Web service and service of windows in use.

    maximum peak of 50000 concurrent users load.

    A windows Server 2008 dedicated would just?

    Can he handle that kind of load?

    What are the other options? Please advice

    Hello

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for Windows Server on Technet. Please post your question in the Technet forums. You can follow the link to your question:

  • Need to write the cursor to update the column

    Hi all

    I want to write a cursor in the CALC_TAX of the PP_TAX of the UPDATE table column
    Currently I use following update instructions to update the CALC_TAX column.

    UPDATE PP_TAX P
    SET CALC_TAX = ROUND (((P.ACTV_AMT * 5)/100), 2)
    WHERE PROV_DEC_FOR_TAX ("AB", "NT", "YT", "NAKED", "NV");

    UPDATE PP_TAX P
    SET CALC_TAX = Round (((P.ACTV_AMT * 5)/100), 2) + Round (((P.ACTV_AMT + Round (((P.ACTV_AMT * 5)/100), 2)) * 8.5) / 100), 2)
    WHERE PROV_DEC_FOR_TAX ("QC");

    UPDATE PP_TAX P
    SET CALC_TAX = Round (((P.ACTV_AMT * 5)/100), 2) + (((P.ACTV_AMT * 7)/100), 2nd round)
    WHERE PROV_DEC_FOR_TAX IN ("MB");

    UPDATE PP_TAX P
    SET CALC_TAX = Round (((P.ACTV_AMT * 5)/100), 2) + Round (((P.ACTV_AMT + (Tower (((P.ACTV_AMT * 5)/100), 2)) * 10) / 100), 2)
    WHERE PROV_DEC_FOR_TAX IN ('PE');

    UPDATE PP_TAX P
    SET CALC_TAX = Round (((P.ACTV_AMT * 5)/100), 2) + (((P.ACTV_AMT * 5)/100), 2nd round)
    WHERE PROV_DEC_FOR_TAX ('SK');


    UPDATE PP_TAX P
    SET CALC_TAX = Round (((P.ACTV_AMT * 13)/100), 2)
    WHERE PROV_DEC_FOR_TAX IN ('WE', 'NB', 'NL', 'YY');

    UPDATE PP_TAX P
    SET CALC_TAX = Round (((P.ACTV_AMT * 12)/100), 2)
    WHERE PROV_DEC_FOR_TAX IN ("BC");

    UPDATE PP_TAX P
    SET CALC_TAX = Round (((P.ACTV_AMT * 15)/100), 2)
    WHERE PROV_DEC_FOR_TAX IN ('NS');

    Kindly help.

    This is what it would look like for the first two,

    UPDATE pp_tax p
    SET    calc_tax =
             CASE
               WHEN prov_dec_for_tax IN ('AB', 'NT', 'YT', 'NU', 'NV') THEN
                 ROUND ( ( (p.actv_amt * 5) / 100), 2)
               WHEN prov_dec_for_tax IN ('QC') THEN
                 ROUND ( ( (p.actv_amt * 5) / 100), 2) + ROUND ( ( ( (p.actv_amt + ROUND ( ( (p.actv_amt * 5) / 100), 2)) * 8.5) / 100), 2)
             END
    WHERE  prov_dec_for_tax IN ('AB', 'NT', 'YT', 'NU', 'NV', 'QC');
    

    Just add several WHEN clauses and include in the list of in WHERE clause.

    Concerning
    Peter

  • How is it, my upper toolbar disappeared? I have no file, edit, bookmark, tools, ect. I also place my cursor at the top of the screen for my address bar to fall down. Why?

    That's about it, my whole screen is taken up by some site I'm on. Need to put my cursor at the top of the screen just to get the arrow to the left, and the toolbar above it does not exist, no matter what I do.
    When Windows or even Internet Explorer everything is where it is supposed to be. Only when we Firefox makes it happen. He is good enough to drive my nuts!

    Make sure that you run not Firefox mode full screen (press F11 or Fn + F11 to toggle; Mac: Ctrl + Shift + F).

    If you are in full screen view then hover over with the mouse upward to make the bar appear Navigation and tab bar.

    You can click the maximize button in the upper right to leave the mode full screen or empty space of a right-click on a toolbar and use "exit full screen" or press F11.

  • You will need to insert update column with the username?

    Hi all

    I'm new to this forum of the apex. New to apex as well.

    My question is do we have a form and a single column is editable by the user. whenever an update to this column, I need to write their name in the update column.

    I heard that we can do with trigger using the variable app_user. But in our project, they made authentication ldap for this form and when an employee login with their company login id they can see only this form of apex. no other option.

    In the same form, they were able to show the user name. I checked how they did it. they used * & user * variable for this. , It makes sense for you gentlemen?

    all I have to do is insert this & user in the column value.

    How to do this. I'm started working in the apex for the past four days alone. willing to bare with me if im a very stupid question.

    Thank you
    knani

    PS: I know that what im asking is the user name for the Web page the user name of the apex.

    Published by: kart on May 26, 2010 11:45

    Hello

    You can use: APP_USER substitution string.
    If you like to use that in the syntax of database trigger is v('APP_USER') for example

    :NEW.CHANGED_BY := NVL(v('APP_USER'), user);
    

    BR, Jari

  • Need help to write a program for the acquisition of signals.

    Hello

    I need to write a program that will do the following:

    1 acquire two signals simulated,

    2. make 10 averages the signal,

    3. filter the signal,

    4. display the signal in its raw form and the power spectrum (fft),

    5. save the data using writing to the file vi

    I tried it for awhile, but there's always something does not... None of the experts LabVIEW here can help me?

    Thank you 1 million.

    -Deet

    No one here is going to do your homework for you. Please join what you have written so far and explain the specific problem that you are experiencing.

  • I need to remove the uneeded files: Purenetworks and PCFix. But I get: not deletenmrsrc.dll: access denied make sure the disk is not full or write protected and that the file is not in use.

    Original title: remove unnecessary files

    I need to remove the uneeded files: Purenetworks and PCFix. But I get: not deletenmrsrc.dll: access denied make sure the disk is not full or write protected and that the file is not in use.

    Ditto for PCFIX.exe.

    How can I remove these and clean unnecessary files? Thank you.

    Hello

    1. how exactly you are trying to remove it?
    2 have you connected the administrator account?

    Step 1: Check if the problem persists in the clean boot state.

    From your computer by using a minimal set of drivers and startup programs so that you can determine if a background program is interfering with your game or program. This type of boot is known as a "clean boot".

    Reference:

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:

    1. click on start and then click Run.

    2. type msconfig and click OK.

    The System Configuration Utility dialog box appears.

    3. click on the tab general, click Normal Startup - load all services and device drivers and then click OK.

    4. When prompted, click on restart to restart the computer.

    Step 2: Take possession of these program at the following location folder, and then check the issue. C:\Program Files\ 

    Reference: How is ownership of a file or a folder in Windows XP

  • a disk error has occurred while trying to write the following file

    I was working on my video and I put in a video file and a 10 seconds later, I get an error saying "a disk error occurred while trying to write the following file.

    and audio of the video was not working I close Premiere Pro and open again to do the same thing and it happens again if you know how to fix this please tell me I need to change my video so I can get it to the top on youtube tomorrow.Help pls.png

    I contacted support and it turns off everything, I had to do was move the first clip on the desktop... lol Thanks much for the great help! Sorry for the trouble

  • HP: I need the month and the year of manufacture of the following numbers. Can you please help

    Can you please help me with the manufacturing of the year and the month of the following computers portable

    [Personal information]

    Hello:

    Take a look at the first serial number you posted...

    The 4th character from the left is the year of manufacture.

    In the first case, it is either 2005, 2015 according to the model (that would be obvious based on the hardware of the laptop has, or when you bought).

    The characters of 5th and 6th from the left indicate the week of manufacture.

    If you need to take another look at the first serial number because 3-b is probably a 38 (which means the 38th week of the year).  Like all the others who have two numbers in the 5th and 6th places.

    The 38th week of the year is sometime in September.

  • Need the following .vi9 (s)

    Hello if anyone can help me with the screw following their inclusion in a legacy of 2000 software:

    • binRead.vi
    • findMinMaxfromCenterRange.vi
    • IndexToTimeConv.vi
    • CalcDecimateFactor.vi

    I need them, because when I open the Legacy with LabVIEW 8.6.1 software it shows them in the form of blocks with a question mark.

    Thank you


  • need drivers for the following!

    need driver for the following equipment. in fact, it shows as unknown device in my Hp probook g1 450 4th generation i5.

    ACPI\HPQ6007
    * HPQ6007

    I would be happy if you please give me the link of the drivers.

    You need HP 3D DriveGuard on your list of pilot. Choose which operating system you are running and you will pass to the right page:

    http://h20566.www2.HP.com/portal/site/hpsc/public/PSI/swdHome/?cc=us&lang=en&sp4ts.Oid=5405426&AC.admitted=1412400073783.876444892.199480143

  • Don't know what updates I need through the center of update. And get the following error message popup every minute, wuauclt.exe.

    Please, I beg you, help me please I need this computer for my work and am already 1 day behind by logging into my company to do my job (I have Windows XP Version 2002 service pack 2)

    Not only can't update windows via the update enter but an error message continues to appear every minute that used to go.

    It says "wuauclt.exe has encountered a problem and needs to close. We are sorry for the inconvenience. »

    If I click on th does not send or send error report this message keeps popping up. When I click the to see what data link, he said:

    "Error signature szAppName: wuauclt.exe szAppVer: 7.4.7600.226 szModName: szModVer esent.dll: 5.12600.2180 offset: 005d 424 '  Details of the declaration: this error report includes: observation information covers the status of wuauclt.exe when the problem occurred, the operating system version and used hardware and Protocol address Internet (IP) of your computer. etc, etc, etc.

    When I click on info tech I get

    Content error report the following files should be included in this error report: C:\DOCUME~1\Owner\ LOCALS~1\Temp\WER189a.dir00\wuauclt.exe.mdmp C:\DOCUME~1\Owner\ LOCALS~1\Temp\WER189a.dir00\appcompat.txt WER189a the number changes each time.

    So far, I ran McAfee, Microsoft Security Essentials and it keeps popping up. I still do not know what updates I need through the Update Center but could manually go and get service pack 3 by itself. I need to be able to use the center of update and do not have this message continues to flow upward.

    What I do?   Thank you so much Corina

    Hello
     
     
    Let us make the below listed methods and check if we still get the error message.
     
    Method 1.
    I would ask you to reset the Windows UPdate components and check if you still get this error message.
    Click the Fix It button in the article below to do it automatically or you can do it manually as wel. For more information, refer to the article below.
    How to reset the Windows Update components?
    http://support.Microsoft.com/kb/971058
     
     
    Method 2.
    If the error still persists please provide us with the error log:
    Type eventvwr.msc/s in the address bar.
    The list of all the events that are listed as 'Error' in the main window when you go to 'Newspapers Windows' and 'Application '. There is often a large number of them. Send us any ones you see listed for the last few days. (Please also do it for the log files in 'System'). When you do, provide us the name of the 'Source' and all that is listed in the description below the list of newspapers box when you click on one.
     
    Method 3.
    I would also recommend to install the Windows Update Agent to manage the updates on your computer.
    Download and install the Windows Update Agent to manage updates for your computer.
    Follow the link below to download and install Windows Update Agent:
    http://support.Microsoft.com/kb/949104

    Please let us know if this helps you resolve the problem or if assistance is needed.

    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

Maybe you are looking for

  • selection of a video card

    We have a 6674y Pavilion with an operating system of Windows 7 64 - bit and a HD4200 graphics card.  I want to upgrade the video card series Radeon 6700 or a compatible card.  I don't know how to say exactly if this card would work in the computer or

  • 4K Inspiron display 7559 (16 GB of ram, 960 m GPU)

    Hi, how can I turn off the auto graphics card (dashboard to dedicated) I want to use only the dedicated GPU (NVidia 960 m) on my laptop. Thanks in advance

  • Reinstall Windows 7 no drive

    A simple enough question, I got a pre-built desktop HP that came with W7 professional, but I effed during the installation and took the wrong language, which apparently I can not change after the fact, but only with a complete operating system reinst

  • STOP: 0X0000005C (0X0000010B, 0 X 00000003, 0X00000000, 0X00000000)

    I HAVE THIS BLUE SCREEN ON MY DESKTOP AFTER I UPGRADED TO WINDOWS 7. MY PC WORKS FINE WITH WINDOWS XP UNTIL I HAVE INSTALL WINDOWS 7. I HAVE CHECK AND RUN THE WIN7 SOFTWARE TO CONFIRM THAT MY OFFICE IS OK TO DO THE UPGRADE, BUT AFTER I PUT IN THE DIS

  • Windows 7 not recognizing not not hard drive enclosure

    I want to access (files) to a XP disc that would no longer start. I bought a hard drive enclosure, installed XP inside drive and plugged into my new computer (Windows 7). Windows Explorer does not display the drive, even after restarting the computer