Display the column name of the column more recently updated

I wonder if it is possible to display the name of the column in the column most recently updated in a table.

Example:

Emp table

Name

Height

Weight

Age

Update_Date

Update_Column

Original record (03/20/14)

Name size weight Age Update_date Update_Column

John                                                 03/20/14          Name

Then someone comes and update the height on 22/03/14:

Name size weight Age Update_date Update_Column

John 5'9 03/22/14 height

And the Update_date and the Update_column would change again if someone came and put a value for the age. And so on.

Is this possible?

Also, if the above is possible, would it be possible to display the name of extreme right column if a user updated several columns at the same time?

Example:

User updates the sub-folder:

Name size weight Age Update_date Update_Column

John 5'9 03/22/14 height

And adds weight and age at the same time on 24-03-14:

Name size weight Age Update_date Update_Column

John 5'9 150 31 03/24 / 14

The Update_Column would display age because it is the furthest to the right. (Think by reading from left to right, the column that has been updated if the extreme right)

So to sum things, I need to be able to display Updated_date (which will be the date of the day when the record is the last updated) and Updated_Col (which is the column name of the column was last updated, and if multiple columns are updated then display that value has been updated last in)

I hope that the examples help to clarify things.

Thank you

Steven

I think I found a solution.

delimiter //
create table a (
  id int (10) unsigned auto_increment,
  a int(10),
  b int(10),
  update_date datetime NULL,
  update_column varchar(16) NULL,
  primary key (id)
)//

create trigger bu_a before update on a for each row begin
  set NEW.update_date = NOW();
  set NEW.update_column = NULL;
  -- you need to start with the rightmost column if you want
  -- that matched with the highest priority
  if OLD.b != NEW.b then
   set NEW.update_column = "b";
  elseif OLD.a != NEW.a then
   set NEW.update_column = "a";
  end if;
end //

TEST

insert into a (id,a,b) values (1,1,1), (2,1,1), (3,1,1), (4,1,1)[
update a set b = 2 where id = 2;
update a set a = 2 where id = 3;
update a set a = 2 where id = 4;
update a set b = 2 where id = 4;
select * from a;

DISPLAY

ID  A   B   UPDATE_DATE                    UPDATE_COLUMN
1   1   1   (null)                          (null)
2   1   2   March, 24 2014 23:22:33+0000      b
3   2   1   March, 24 2014 23:22:33+0000      a
4   2   2   March, 24 2014 23:22:33+0000      b

Tags: Database

Similar Questions

  • with the auto more recent updated version of firefox now there is a white bar that appears when you move your mouse over this area. I want that gone, how?

    When you move your mouse below the address bar opens a white bar, making it so you can't click on buttons or links on sites, like buttons connection for example. also when using the full screen, you can no more mouse on the tabs at the top of the screen, only this white bar appears. This prtty much kills its use full screen for me. Thus, this white popup bar and mode full screen with the white bar without tabs firefox has pretty much ruined it for me. in any case to fix it would be great.

    Launch Firefox in Mode safe

    While you are in safe mode;

    Firefox Options > advanced > General.

    Find and stop using hardware acceleration.

    ===================================

    Hello

    To better help you with your question, please provide us with a screenshot. If you need help to create a screenshot, please see How to make a screenshot of my problem?

    Once you have done so, attach the file to screen shot saved to your post on the forum by clicking on the button Browse... under the box to post your reply . This will help us to visualize the problem.

    Thank you!

  • Ms more recent update for my VISTA plus old (2008 Acer laptop) was the last event, now cannot start PC... recovery tests without success... Help, please...

    Ms more recent update for my VISTA plus old (2008 Acer laptop) was the last event, now cannot start PC... try to recovery without success, a loop back and asking to recover or normal boot...  Attached to jumps, safe to ask if I want to recover...  I never received an OEM of VISTA version, but the first time having problem after all these years...   Help, please...  Would contribute to a boot disk, if so, how can I get a copy?...  Thanks, Dave * address email is removed from the privacy *

    Hello

    See if that helps you.

    Do a Safe Mode system restore to before the problem started.

    http://bertk.MVPs.org/html/restoresysv.html

    How to access Safe Mode

    http://www.bleepingcomputer.com/tutorials/how-to-start-Windows-in-safe-mode/#Vista

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    If it doesn't, try a startup repair and / or a system restore using a DVD of Vista from Microsoft

    Manufacturers recovery disks normally do not have Service Options; they are normally a relocation to the factory only settings option.

    Here is the guide to repair Options using a Vista DVD from Microsoft.

    If a friend or a work acquantance of yours has one, you can borrow and use it for repairs.

    http://www.bleepingcomputer.com/tutorials/repair-Windows-with-Windows-Startup-Repair/

    Table of contents

    1. Overview of Windows Vista repair options
    2. How to perform an automatic repair of Windows Vista using Startup Repair
    3. Advanced Tools Overview
    4. Conclusion

    If you do not or can not borrow a Microsoft DVD there is a download of a file ISO of Vista Startup Repair available that you can put on a Bootable floppy to make the above startup repair and that the method is recommended by a large number of posters in these Forums.

    Unfortunately, you have to buy it.

    Here is a link to it:

    http://NeoSmart.net/blog/2011/Windows-Recovery-discs-updated-reinstated/

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    And here's how to use Recovery of Acer.

    http://Acer.custhelp.com/app/answers/detail/A_ID/2631

    To start the system recovery:

    1. Restart the computer.
    2. When the Acer logo appears on the screen, press the left Alt and F10 keys.
    3. If you are prompted with a Microsoft Windows splash screen, press the Enter key.
    4. After that the Acer eRecovery Management application is loaded, select your type of restore.
    5. Read the review and then click Next when you are ready.
    6. Click Next to start the restore process. It may take 10 minutes up to an hour fom anywhere to restore.
    7. Once the restore is complete, your computer will restart. After the reboot it will load Windows and start the installation of your software and drivers. Your computer will restart several times during this process. Once they are all completed, your computer will be like it was when you bought it first.

    See you soon.

  • I receive I/O-ERROR in bridge CC when I try to access the outputmodule. I have instaled the wersion more recent module, but it does not solve the problem. What should do?

    I receive I/O-ERROR in bridge CC when I try to access the outputmodule. I have instaled the wersion more recent module, but it does not solve the problem. What should do?

    reset your preferences: https://helpx.adobe.com/bridge/kb/troubleshoot-errors-freezes-bridge-windows.html

  • Anyone succeeded with the installation more recent universal Google Analytics?

    Analytics universal is a little more recent, so I hope that someone has tried to work with it. This is not the original form of Analytics; I have need help with it.

    I have the js code in the main template that all of my pages use. I used the google tag Manager to check if the code has been successfully installed and the tag manager says it's.

    However, google page analytic says that it is not installed correctly, and if it does not all universal anaytics data such as real-time monitoring.

    I know this might be a problem with google, but I wanted to ask here just in case someone has experienced this problem.

    Thanks in advance.

    Oh, and the site I'm trying here

    I thought about it. Made a tutorial: How to Set Up Google Analytics in Adobe Muse just follow this link

  • More recent update problem El Capitan

    I tried to update my os el capitan 10.11.3 and its deadlock. What will I do?

    Post edited by: adlib3120

    If the information displayed in this window has not changed, it may take several hours if

    your internet connection is not fast, or if you are using wi - fi and not Ethernet connection (it's faster)

    or, if for any reason any servers and your internet provider is either busy or slow right now.

    You can cancel these elements or pause the and try to update or upgrade later.

    The computer must be restarted in safe mode if there is no doubt, because who would repair the

    disk and make a few minor (if necessary) and then restart the computer normally to be

    get out of safe mode. • Try safe mode if your Mac does not commissioning - Apple Support

    Or, if you're happy with the hours of waiting, to see if everything is downloaded which can work

    too much; Some users had to wait four to eight hours to get the upgrade of system files. If for some

    reason you decide to stop, pause, or stop the updates, you might need to start under OS X

    Recovery, if the computer fails in safe mode or normal boot/re-boot. A

    repair disk can be made, or other tools and options available.

    • OS X: on OS X recovery - Apple Support

    Don't know what else to suggest and little time has passed since your posted your request.

    Some would say 'waiting' for the files to download all the... There is a 1.4 GB 10.11.3 combo update

    here: Download OS X El Capitan 10.11.3 Combo Update

    Good luck & happy computing!

  • artists are to display the window more than once in sync

    iTunes version 12.2.4.   In the timing window on the right side under "Artists" of some artists appear more than once.

    For General and advice on the Organization of the iTunes, see grouping of tracks in albums . In particular, any given artist name should be spelt constantly everywhere where it appears in the two fields artist album and artist, and still have the same sort value.

    TT2

  • Yahoo Health does not display the tiles more

    Until yesterday, the health of yahoo and other links yahoo would display tiles from photographs that have links to other articles. Like you I want to scroll down, other tiles seems (even in IE). Now there is no tiles at the bottom of the page.

    This works fine for me in the same version of Firefox.

    Try Firefox Safe mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that temporarily disables hardware acceleration, restores some settings and disables add-ons (extensions and themes).

    If Firefox is open, you can restart Firefox Safe mode in the Help menu:

    • Click the menu button

      click Help

      then select restart with disabled modules.

    If Firefox does not work, you can start Firefox in Mode safe as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    When the Firefox Safe Mode window appears, select "start mode safe."

    If the problem is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme or hardware acceleration. Please follow the steps described in the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. This might help others with the same problem.

  • The module page should include the date at which each add-on has been more recently updated to help diagnose problems.

    Sorry, this isn't a question, but a suggestion. If a conflict exists between the modules, it would be useful to know that it has been updated recently. I often keep track of myself, but it would be easier to have this information on the page Add on.

    "Last update" is available from the display of the modules for each module by clicking on the "More" link... "just below the name of the add-on. Scroll down on this new view of the page.

    An add-on that lists information about all Extensions or Plugins, including the date of update (last updated date shows in the options for the Extension List Dumper as "Date of installation")

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

    Not related to your question, but...

    You may need to update some plug-ins. Check your plug-ins and update if necessary:

  • 6.1 VDP on vSphere WebClient 6.0 fails to display the status of recent tasks (VICLIENT shows something completely different... real information!)

    Hello

    Running vCenter 6.0 and 6.1 VDP and after launching a backup job (via web client vSphere) I can see the beginning of the task, but only using recent tasks of the viclient (IT IS NOT display any status or progress via the web client).  Now what makes this problem, a question is that of the virtual machine, I didn't go to the backup task to create a shapshot.  The ONLY REASON I know this is because recent tasks viclient showing the progress of the task of backup drew my attention to the question.  Even after a refresh several times in the webclient service indicates that the work was done, never completed, or FAILURE under section tasks recent.  Research in the section alarms the web client fails also show no indication that there was an instant failure on one of the backup jobs.  The only way to view the State would look at Console tasks in web client I could also see the work and not a backup but unless you have already searched for failure would not have known you.

    It's very relative when VMware push customers to use the web client over and the viclient seems even less we continue losing features.  Has anyone else had this problem with VDP 6.1?  If so is some fix allow some "RECENT TASKS" to actually show the same status in the web client and the viclient (they speak both the same vCenter then why don't they contain the same information?)  Accurate builds I use are the following

    vCenter Server 6.0.0 build 3018524

    POS 6.1.1.19

    ESXi 6.0.0 build 3620759

    And before his suggested the race the POS 6.1.2 (latest version), I've tried and that version had problems more large gel and omitting so I use the version seems to be more stable :-)

    Not sure that you use the same user used in POS configuration page Try connecting web client with the user used to record POS with vCenter.

  • How to display the charging icon when updating of charts

    Hello

    in my actual page, I have an IR and a chart based on the data presented in the ir. When the user applies a filter in the ir, the data in the chart changes. to achieve this, I retrieve the State of the ir filter, rebuild the graphical application, a refreesh in a DA triggered after the update of the IR region.

    So far so good. now my problem:

    the graphical query is sort of a long walk. This means that it takes about 30 seconds to get the data. First, the graph is displayed, it said "loading data". so that the user knows that he (or she) have to show patience.

    but during the refreshing of the region of cat and re - run the query the old values are presented. as long as the new query is running. Once the query has been completed, the table is updated, new data are presented.

    what I want is to give the user some sort of information, new data are loaded. either by disabling the table before you start the new query, either by showing any sort of reload the icon or the text.

    can you give some advice my way to reach one or other purpose?

    Greetings

    Peter

    (APEX 4.2)

    Hello yeti.

    In your DA trigger "discount for after ' IR in which you rebuild the query and refresh the chart area:

    • Add/before the first chart refresh 'Real' action 'Execute JavaScript code' with the code like:
    apex.widget.waitPopup();
    
    • Add the last 'Real' action "Execute JavaScript Code to the code like:
    $('#apex_wait_popup').remove();
    $('#apex_wait_overlay').remove();
    

    It will show the Oracle APEX waiting popup with loading image and an overlay to disable the interaction of the user with the page until your DA runs and then remove the popup of waiting and the cache.

    Kind regards

    Kiran

  • Firefox can be configured to open the Firefox more recently-active window when you click on a link in another application? Using multiple profiles.

    I think it's really a feature request, but I don't see a forum for this. I used to use firefox almost exclusively, but switched to chrome when I started working freelance for a couple of different companies - the identities of chrome feature really helps me keep my sanity by having a unique identity for each company. However, a problem has recently developed with chrome which brought me back to firefox. The profile under firefox feature seems to have gotten much better since I made the first move, and I'm pretty happy with the way it works... with one exception:

    With firefox, clicking on a link in another application, always opens in the default profile. With chrome, she would always open in the browser window that was most recently active. It's a very intuitive behavior, because everything I do in the other application (e.g. thunderbird, evernote, Skype) is almost always linked to whatever browser window, I had finally opened.

    Any chance to do this implemented? Or maybe there is already a way to do this? I found the following related topics, but neither helped with this issue:

    https://support.Mozilla.org/en-us/questions/981608?ESAB=a & As = AAQ
    https://support.Mozilla.org/en-us/questions/983341?ESAB=a & As = AAQ

    The 'solution' to this topic is that there is no real solution so that the owner of this thread wants to happen.

  • Have you the more recent update of Adobe removed the option Save As Image?

    Maybe I'm missing, but I was able to save a PDF as an image in Adobe Acrobat pro. The program updated the other day (maybe it's the update of DC?) and now I do not see the option to save an image.  This feature has been removed, or is it just located somewhere else?

    Check if you are still under Acrobat Pro - that it has not transformed into Acrobat Reader for example.

    You have MacAfee? You have creative cloud?

  • Has anyone lost the film script of the advanced models (tree, flame, etc.) with more recent update?

    It seems CC update Photoshop on the last version, I lost the advance script options. Sounds like the old Menu of bosses.

    It is now proposed in the menu Filter > render

    Gene

  • Video player blackBerry 10 will display the video after OS update

    Just installed new update OS on my Z30. Does not open video player video but I have sound

    He started working on his own

    Thank you

Maybe you are looking for