SQL help. Identify changes to a field.

Greetings!
PS/SQL is not an option for me. I need help to use SQL, if possible for the following scenario.
Oracle 10G.

Table: JOB_DATA

EMPLID, DATE_EFF, DEPTID, JOBCODE
100, 01/11/2012, 34567, MNG
100, 01/10/2012, 34567, SUP
100, 01/09/2012, 28967, MNG
100, 15/08/2012, 28967, SUP
100,6/30/2012,15879, MNG

I need to get the following records only, in other words, every time that changes in the Department ID.

100, 01/10/2012, 34567, SUP
100, 15/08/2012, 28967, SUP
100,6/30/2012,15879, MNG

Thanks in advance.

It looks like you want something like

SELECT *
  FROM (SELECT j.*, lag(deptid) over (partition by emplid order by date_eff) prior_deptid
          FROM job_data j)
 WHERE prior_deptid IS NULL
    OR prior_deptid != deptid

Justin

Tags: Database

Similar Questions

  • I'm desperate. Help to change the additional e-mail address.

    Nice day!

    My additional email address is missing, because the field has been deleted (russia.ru). Questionnaire responses because I forgot. Help please change the address on the action.

    I can't call tech support, because I can't talk. I can write only.

    I can confirm his identity by any means. I'm honest owner identification.

    Help, please!

    Maybe I chose the wrong topic. But now I have no way to update the program and stopped all the work and must be updated.

  • SQL script to change the database user

    Oracle 11g on Solaris 10.5 64-bit SPARC

    I work on generate a SQL script to change all default users to a new or custom password.
    Example: change the system of the user identified by new_password

    Problem:
    My problem is that I don't want the 'new_password' be in plain text, because the script will on the ground prior to deployment.
    Can anyone give me some suggestions?
    Is this doable or I can generate the already hashed password - as change User Manager idenfified < hash_characters >

    Example change manager users identified by 'HE5823WE4095432241252 ';

    You can use the hashed password if you say for example:

    change the system of the user identified by values 'hashed_password_string '.

  • need help to change my macbook pro hdd

    Hello. need help to change my macbook pro 13 "mid 2012 hdd. witch HDD I buy 1 TB 7200 RPM 2.5 witch should I choose sata2? or sata3? If you know any suggestions, it would be really appreciated. And when I add the new hard disk can you restore with lion at el capitan?

    Thanks for the help.

    A 2012 MBP has SATA 3 connectivity.

    If you want to install a new HARD drive, the best approach is to clone the new from the old HARD drive.  It will duplicate the original HARD drive which has likely El Capitan installed.  I suggest to use Carbon Copy Cloner to the process.  It is not free, but worth it because you can use it to create a backup disc drag.

    Here's the Setup instructions for your MBP:

    http://eShop.MacSales.com/installvideos/macbookpro_13_unibody_mid12_hd/

    Ciao.

  • Dear community, I need help to change my email and rescue security question

    I need help to change my email of relief. First of all, I don't remember my Security Question. Second, when I click the reset security question and no email has been send to my email of relief. That's why I need help with these two questions

    Unless the email in a spam filter, you have to ask Apple to reset your security questions. To do this, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    (137729)

  • I need help to change my settings

    My local library has given some of their old computers because they have upgraded and got new. I was lucky enough to get one of these free computers and it works fine. However, I need help to change its settings. The computer will save not things once I turn it off. I guess that one who originally put the computer settings in place did not want the personal files of the user to be saved because the computer was for public use. Whenever I tried to turn off the computer or restart everything I've saved, changed, and/or downloaded is deleted and it goes back to how it was when I got it. How can I change the settings so that I can record things even when I turn it off? By the way the computer is an HP 75 PC with Microsoft Windows Professional Version 2002 - SP2

    The library may be installed as Windows SteadyState software that cancels the changes that make users.  If it is your computer, you can discover how to uninstall in the Windows SteadyState forum.

    If possible, I would recommend formatting the computer's hard drive, reinstall Windows from scratch and installing all the Windows updates available.  It is the only way to ensure that your computer is clean and not infected.

    Boulder computer Maven
    Most Microsoft Valuable Professional

  • How to change the image field captures screenshots automatically from BMP to JPEG

    How to change the image field captures screenshots automatically from BMP to JPEG

    I want to say, when I tap on the screenshot on my keyboard and paste this image in microsoft photo editor or picasa 3.0 areas of the bitmap .bmp. instead of asking the witch I´d field prefer.
    So, I open that image on the brush to convert it to. JPEG.
    It's hick very!
    is it possible to easily me this step and save or paste pictures in JPEG on my files automatically?

    Hello

    I saw that article when I was looking for one that I posted...

    I understand your problem, and the answer is that, to the best of my knowledge... NO..

    Windows records the capture in memory as bitmap, along with, even if you can paste it directly into a folder, it would be in the form of bitmap...

    The best I could find is to use the suggestion in the link I've included which refers to the

    Windows Key + PrintScreen to automatically record is in PNG format in your pictures folder...

    The only way to do what you want is with a 3rd party capture program that can be configured to save in a directory as a specific file type...

    Personally, I use a program called print screen Deluxe for this... it is a purchased program...

    I'm sure you could find something free to do what you need...

    You may need to use a different key for print screen, but the software can allow you to reprogram the PrntScrn key...

  • How to change the search fields displayed on the homepage of UCM 11g?

    Hello

    How to change the search fields displayed on the homepage of UCM 11g?

    Another option for you.

    Follow the links below.

    How to: Customize the home page of Oracle UCM with configuration manager. -Blog of BlueStudios Johns

    Example of a custom component.

    bluestudios.co.uk/blog/wp-content/uploads/2009/02/ether_homepage1.zip

    -Prashant

  • Dear Sir/dear Madam, two days ago I registered to use creation of cloud photography package 300 THB per month LR + PS. And I see the promotion for this package 240 THB per month. Could you please help to change promoting 240 THB? Thank you.

    Dear Sir/dear Madam, two days ago I registered to use creation of cloud photography package 300 THB per month LR + PS. And I see the promotion for this package 240 THB per month. Could you please help to change promoting 240 THB? Thank you.

    This is an open forum, not Adobe support... below to connect with Adobe personnel to help

    While the forums are open 24/7 you can't contact Adobe support at any time

    Chat support: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • My set-up agency &amp; ABC developed for us. We no longer use the Agency. I have 2 log-in - but 1) cannot change my billing settings &amp; 2) cannot update models due to lack of access. Need help to change this.

    My set-up agency & ABC developed for us. We no longer use the Agency. I have 2 log-ins - but 1) cannot change my billing settings & 2) cannot update models due to lack of access. Need help to change this.

    Hi Rebecca,.

    You should get in touch with our accounts team to work a solution to your problem. Drop them a note at: contact us | Adobe Business Catalyst

    Cristinel

  • help to change the size of precomp (weight and size using the script)

    Hi guys, need help with change precomp size (weight and size using the script), my problem in this... when I change the size of the model (height and weight) of GUI AE, AE change the size of the composition of the Center model, but if I change the size of the model of my script it change from upper left... so I need some how change in the center of scripts of composition or something like that?

    now I change size with this code

    MyComp.Width = myComp.Width.Width + 50;

    MyComp.Height = myComp.Width + 50;

    Hi Zipkiev,

    If you want to change the composition and all the layers it contains, there is a script: scale Composition.jsx that comes with Ae (in the Scripts folder) which does exactly the same thing.

    He puts on a scale by a factor uniform using a temporary null object. You can twist no uniform scaling by a factor.

    But if you want only to preserve the size of the layers and adjust their position so that their new position relative to the new comp Center is the same as previously, the script above can not help.

    In the simplest situation you just compensate for all positions of layers related by the same amount: [(compNewWidth-compOldWidth) * 0.5, (compNewHeigth-compOldHeight) * 0.5].

    Not sure it will work well in all situations (such as 3D with cameras).

    You can try it, it might work for you:

    COMP is the composition, newWidth, newHeight its new width/height

    var

    DX = (newWidth - comp.width) * 0.5;

    DY = (newHeight - comp.height) * 0.5;

    layer, n,

    p, j,

    value;

    COMP. Width = newWidth;

    COMP. Height = newHeight;

    for (n = 1; n<=comp.numLayers;>

    layer = comp.layer (n);

    If (layer.transform &! layer.parent) {}

    p = layer.transform.position;

    If {(p.numKeys===0)}

    p.value = value;

    value [0] += dx;

    value [1] += dy;

    p.setValue (value);

    }

    else {}

    for (j = 1; j<=p.numKeys;>

    value = p.keyValue (j);

    value [0] += dx;

    value [1] += dy;

    p.setValueAtKey (j, value);

    };

    };

    };

    };

  • "Help text" change for end users?

    Hello

    I like to leave the key end users to change the element help text on the pages of the APEX, without giving access to Apex Builder. Is this possible? We use the APEX 4.1.

    Tamás

    Published by: Tamas Szecsy on May 22, 2012 12:48

    I guess you need to implement a custom solution where you can create a mapping table that holds the info on AID for the ELEMENTS of the apex.

    And change your point label template to get the help of your custom table.

    So now, you could provide the end user with the help of change required function.

  • change of a field

    Hello

    I'm working on a game of Tic Tac Toe. For the move to cancel feature, I have a stack:
    LinkedList<Tuple<Integer, Integer>> stack; //The integers are X and Y coordinates
    Now, the cancellation algorithm does not exactly work as expected and I need to debug it. I would like to monitor any changes in the field of battery and each change to print the contents of the stack and tuple variables. How can I achieve that? I need to put in place a kind of Observer pattern?

    Thank you
    PR.

    Aardenon wrote:
    Now, the cancellation algorithm does not exactly work as expected and I need to debug it. I would like to monitor any changes in the field of battery and each change to print the contents of the stack and tuple variables. How can I achieve that? I need to put in place a kind of Observer pattern?

    Yes. You must change all methods that are able to change this battery, so they have for example will display the contents of the stack when it is called.
    There is simply no way to say that 'I want to watch this particular variable' and have the virtual machine do the work for you. That's all for the programmer.

  • Help with MS Access SQL Developer Import (problem of DateTime field)

    So here's my dilemma...

    I am currently trying to import from MS Access to SQL Developer, by exporting MS Access to MS Excel and then import in my table of the exporting Excel sheet. What happens is that when I import the excel sheet, it is does not keep the format of date/time / I tried several different formats, but everyone seems to exclude the time and the date.

    My field of date/time is currently set up like this on SQL Developer:

    DD/RRRR/MM HH: MM: SS AM/PM

    And the Excel sheet, I'm importing the field corresponding, defined as follows:

    mm/dd/yyyy/hh/mm/ss AM/PM

    The answer (s) I'm importing is as follows:

    Date/time physical_cpu server_id

    01/11/2013-12:01:23 AM scc415 6.03999996

    When the record is imported, it eliminates the time, so the imported data are:

    Date/time physical_cpu server_id

    01/11/2013 6.03999996 scc415

    Any idea on how to get this timestamp to import properly? Many appreciate the ideas in advance!

    Looks like I have found the solution. For some reason, export to leave access to Excel first and then open and save the file as a .csv instead of a .xlsx, date/time information are maintained. This problem has been resolved.

    Found the solution on the following link for anyone interested.

    Import from excel using SQLDeveloper date/time field

  • Virtual keyboard hides part of the change to the field

    Hello

    I have a labelfield, field change and a button that are centered aligned vertically. The three fields, I added in a Verticalfield Manager which is then added to a horizontal region Manager. And finally the HFM is added to an another value for money. Now in the 9800 device or curve 9380, I noticed that when I touch the edit field, virtual keyboard is coming. And he hides the field partially change.

    I want to move things to the top when the virtual keyboard appeared. How can I do. My code is here:

           HorizontalFieldManager hfm = new HorizontalFieldManager();
            VerticalFieldManager vfmComponent = new VerticalFieldManager(USE_ALL_WIDTH);
            vfmComponent.add(lfServerUrl);
            vfmComponent.add(mEfURL);
            vfmComponent.add(mBtnSave);
            hfm.add(vfmComponent);
            int topEmptySpace = (Display.getHeight() - (Bitmap.getBitmapResource(mStrTopBar).getHeight() + hfm.getPreferredHeight() + 25)) / 2;
            hfm.setMargin(topEmptySpace, 0, 0, 0);
            VerticalFieldManager vfmMain = new VerticalFieldManager(VERTICAL_SCROLL| NO_HORIZONTAL_SCROLL );
            vfmMain.add(hfm);
            add(vfmMain);
    

    Help, please.

    When you start to need as many managers to get the look you want, then you know that you should really create your own Manager.

    These two should help you to do:

    http://supportforums.BlackBerry.com/T5/Java-development/how-to-extend-Manager/Ta-p/446749

    http://supportforums.BlackBerry.com/T5/Java-development/create-a-custom-layout-manager-for-a-screen/...

    For example, I hacked together a "centeringManager" and the screen, which should do what you want.  But please use this as a reference sample, understand what he does and maybe even improve it.

    In production code, I would really remove the centeredManager and centering Manager across all fields and place them, but then you must code a manager which includes margins, which would confuse the point of this example - as a basic implementation of a Manager.

    Hope it's what you want.

    public final class CenteringScreen extends MainScreen {
    
        /**
         * verticallyCenteringManager takes one Field and positions it
         * centered in the space it has.
         */
        VerticalFieldManager centeringManager = new VerticalFieldManager() {
            protected void sublayout(int maxWidth, int maxHeight) {
                if ( this.getFieldCount() > 1 ) {
                    throw new RuntimeException("Expecting only one Field or Manager to be added");
                }
                if ( this.getFieldCount() == 1 ) {
                    Field f = this.getField(0);
                    layoutChild(f, maxWidth, maxHeight);
                    int requiredTopMargin = (maxHeight - f.getHeight())/2;
                    int requiredLeftMargin = (maxWidth - f.getWidth())/2;
                    setPositionChild(f, requiredLeftMargin, requiredTopMargin);
                    setExtent(maxWidth, maxHeight);
                } else {
                    setExtent(0, 0);
                }
            }
        };
    
        /**
         * Fields added to centeredManager will be displayed 'centered' vertically
         * regardless of orientation of screen and presence or absence
         * of virtual keyboard
         */
        VerticalFieldManager centeredManager = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR);
    
        // Sample Fields to be added
        ButtonField sampleButton = new ButtonField("Button", ButtonField.FIELD_HCENTER);
        LabelField sampleLabel = new LabelField("Label", LabelField.FIELD_HCENTER);
        BasicEditField sampleBef = new BasicEditField("Text", "", 255, BasicEditField.FIELD_HCENTER);
    
        public CenteringScreen() {        
    
            super(Manager.NO_VERTICAL_SCROLL); // very important
            // The NO_VERTICAL_SCROLL means that the only Manager added to this Screen - centeringManager -
            // will be given as its maxHeight, the available screen height, regardless of
            // orientation or whether there is a virtual keyboard displayed
    
            // add Fields to centeredManager
            centeredManager.add(sampleButton);
            centeredManager.add(sampleLabel);
            centeredManager.add(sampleBef);
            centeringManager.add(centeredManager);
            this.add(centeringManager);
    
        }
    
    }
    

Maybe you are looking for