Identify when the last update occurred
I have two tables I need to unite. A table has dates that occur for events.
with date_table as ( select 1 ID_Key,to_date('4/1/2013','mm-dd-yyyy') date_val from dual union all select 1 ,to_date('4/2/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/3/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/4/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/5/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/6/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/7/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/1/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/2/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/3/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/4/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/5/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/6/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/7/2013','mm-dd-yyyy') from dual )
The other table there when was the last time the ID_Key has been updated
with Update_table as ( select 1 ID_key,to_date('3/12/2013','mm-dd-yyyy') Last_Update from dual union all select 1 ,to_date('4/5/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('3/1/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/2/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/4/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/6/2013','mm-dd-yyyy') from dual )
I would get the following table
with end_table as ( select 1 ID_Key,to_date('4/1/2013','mm-dd-yyyy') date_val, to_date('3/12/2013','mm-dd-yyyy') last_Update from dual union all select 1 ,to_date('4/2/2013','mm-dd-yyyy'), to_date('3/12/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/3/2013','mm-dd-yyyy'), to_date('3/12/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/4/2013','mm-dd-yyyy'), to_date('3/12/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/5/2013','mm-dd-yyyy'), to_date('4/5/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/6/2013','mm-dd-yyyy'), to_date('4/5/2013','mm-dd-yyyy') from dual union all select 1 ,to_date('4/7/2013','mm-dd-yyyy'), to_date('4/5/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/1/2013','mm-dd-yyyy'), to_date('3/1/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/2/2013','mm-dd-yyyy'), to_date('4/2/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/3/2013','mm-dd-yyyy'), to_date('4/2/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/4/2013','mm-dd-yyyy'), to_date('4/4/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/5/2013','mm-dd-yyyy'), to_date('4/4/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/6/2013','mm-dd-yyyy'), to_date('4/6/2013','mm-dd-yyyy') from dual union all select 2 ,to_date('4/7/2013','mm-dd-yyyy'), to_date('4/6/2013','mm-dd-yyyy') from dual )
Any suggestions?
Just join, help<=, then="" group="" by,="" and="" grab="" the="">=,>
with date_table like)
Select 1 ID_Key, to_date (' 1/4/2013 ','mm-dd-yyyy') date_val of all the double union
Select 1, to_date (' 4/2/2013 ','mm-dd-yyyy') of all the double union
Select 1, to_date (' 4/3/2013 ','mm-dd-yyyy') of all the double union
Select 1, to_date (' 4/4/2013 ','mm-dd-yyyy') of all the double union
Select 1, to_date (' 4/5/2013 ','mm-dd-yyyy') of all the double union
Select 1, to_date (' 4/6/2013 ','mm-dd-yyyy') of all the double union
Select 1, to_date (' 4/7/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 1/4/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/2/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/3/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/4/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/5/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/6/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/7/2013 ','mm-dd-yyyy') of double
), Update_table as)
Select 1 ID_key, to_date('3/12/2013','mm-dd-yyyy') Last_Update in double union
Select 1, to_date (' 4/5/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 3/1/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/2/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/4/2013 ','mm-dd-yyyy') of all the double union
Select 2, to_date (' 4/6/2013 ','mm-dd-yyyy') of double
)
Select dt.id_key, dt.date_val,.
Max (UT.last_update) last_update
of date_table dt.
update_table ut
where dt.id_key = ut.id_key
and ut.last_update<=>=>
Dt.id_key group, dt.date_val
order of dt.id_key, dt.date_val
/
ID_KEY DATE_VAL LAST_UPDATE
---------- ----------- -----------
1-01 - apr - 2013 12-mar-2013
1-02 - apr - 2013 12-mar-2013
1 03-Apr-2013 12 - mar - 2013
1-04 - apr - 2013 12-mar-2013
1-05 - apr - 2013 05 - apr - 2013
1-06 - apr - 2013 05 - apr - 2013
1-07-Apr-2013 05-apr-2013
2-01 - apr - 2013 01-mar-2013
2-02 - apr - 2013 02 - apr - 2013
2 03-Apr-2013 02-apr-2013
2-04 - apr - 2013 04 - apr - 2013
2-05 - apr - 2013 04 - apr - 2013
2-06 - apr - 2013 06 - apr - 2013
2 07-Apr-2013 06-apr-2013
14 selected lines.
Tags: Database
Similar Questions
-
Since the last update to FF, I can't log out of Yahoo and when I close FF it tells me it crashed.
When I try logging out of Yahoo, it comes up with:
The secure connection failedAn error occurred during a connection to login.yahoo.com. You have received an invalid certificate. Please contact the server administrator or email correspondent and give them the following information: your certificate contains the same serial number for another certificate issued by the certification authority. Please get a new certificate containing a unique serial number. (Error code: sec_error_reused_issuer_and_serial)
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified. Please contact the web site owners to inform them of this problem.
I have run CCleaner and erased cookies. Uninstalled and reinstalled FF to no availe.
When I close FF one box comes telling me it crashed.
I can log out of Yahoo in Internet Explorer.
the advantage of this feature to scan https is at least questionable. in order to make it work, avast has sort of a man-in-the-middle 'attack' in order to access the contents of the encrypted connection (firefox supports a feature called pinning of key which can be used by Web sites to address these MITM attacks and who also seems to pick up interference from AVAST).
When you download files via a https connection, they will be analysed by the AV software once they land on your hard drive in any case. However, it should be the job of the Navigator to make it impossible to get infected by malicious software trying to surf around...Edit: Please try to restart the browser once again, it may take a new session for the change to take effect.
-
MY phone is 6 and my phone using the last update (9.3.2) when I type the time massges is stuck... (VIber, imassge, wts place) How can I solve this problem?
Now its all ways stuck not only type
-
I'm afraid to install the last update, because in the past when I update, I always lose something. The last time it was my tabs "pinned". What is the solution?
No, they are not the same. You really need to put more emphasis on messages displayed by editors / moderators / Admins who have extensive validation "under their belt.
-
Since the last update when I load a new web page, the page loads fine but as soon as its loading, it just goes right to the bottom of the page - its very annoying I'm under Aurora on windows XP service pack 3
Thanks Cor - el your advice has solved the problem.
Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).
- Makes no changes on the start safe mode window.
- https://support.Mozilla.com/kb/safe+mode
-
Since the last update of Firefox (Version 4.0.1) I do not see a security lock when I connect my two web sites to secure Bank so am forced to use Internet Explorer for internet banking. I contacted the St George Bank and the ANZ Bank and both say that the problem with Firefox, not their systems. They advise also strongly me to not perform Internet banking unless the security padlock closed is visible in the window secure. The padlock is not visible when I connect secure site of PayPal. Before the upgrade, this problem did not exist and there is no when I use IE. Firefox is my favorite browser.
The status bar everything has been redesigned, so now allows you to check if the site is secure the box to the left of the address (green, blue or plain).
The site identity button | How | Firefox help
Further discussion on this change mention an add-on, you can use if you really prefer to see a lock:
Firefox 4 where is the lower right corner of padlock | Firefox Support Forum | Firefox help
-
I have a mini iPad. He says that iOS 9.3 is available. I plugged into my Mac and opened iTunes to download the update. But when I check the updates, it is said that 9.2.1 is the last update. What's wrong?
Apple withdrew temporarily updating iOS 9.3 for devices more old to deal with some issues, what he was creating. Better to wait a few days for them to correct problems.
-
Firefox last update allows you to initialize OK, but then in short time suddenly block it) whatever the operating mode, but immediately always when you use multiple windows). Obviously the last update has not been sufficiently tested. When will you update the update?
Hello Thomas.
It is possible that you have a problem with some Add on Firefox which is an obstacle to the normal behavior of your Firefox. Have you tried to disable all add-ons (just to see) to see if Firefox goes back to normal?
Whenever you have a problem with Firefox, whatever it is, you must make sure that it is not caused by one (or more) of your installed modules, whether an extension, a theme or a plugin. To do this easily and cleanly, start Firefox in safe mode (remember to select disable all add-ons when you start safe mode). If the problem goes away, you know that it's an add-on. Disable them all in normal mode and allow them one by one until you find the source of the problem. See this article for more information on troubleshooting extensions and theme and this one for plugins.
If you need help with one of your modules, you will need to contact the author.
-
Why my iPod is unchecked music and why he plays an entire album when it is supposed to play songs randomly? This happened some time now. Since the last update? It's really annoying.
Why my iPod is unchecked music synchronization
In iTunes, select iPod (click on its button on the device on the horizontal bar) to show his summary of the settings screen. Make sure that the sync only checked songs and videos is checked. If this is not checked and click apply.
why he plays an entire album when it is supposed to play songs randomly?
On the screen of the settings on the iPod, there is a setting for Shuffle. It's probably on Albums. Set it to shuffle songs.
-
original title: game Fallout 3 on Windows 7 problem
I have install fallout 3 and the last update (1.7), but when starting a new game, he tell me that windows is having a problem reading it & then it locksup, I have a Toshiba Satellite, Fallout New Vegas works perfectly on my laptop, how can I play Fallout 3, is here to play Fallout 3 on windows 7.
Hello
You can see the link provided. It gives information that Fallout 3 is not compatible with Windows 7.
Windows 7 Compatibility Center: Fallout 3 http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/search.aspx?l=en-us&type=software&s=%20Fallout%203&OS=32-bit
You may need to contact the manufacturer of game for support
-
How can I identify the date when the last system restore was used to roll back the pc?
Original title: how System Restore last used
As the title suggests, how can I identify the date when the last system restore was used to roll back the pc?
I can remove all restore points. I've used twice now the beta off Defender & he assures me
the pc is clean Virgin.I have just got rid of a Trojan dropper & a Win 32/AmmyyAdmin. -(whatever it was!)
I now seem to have acquired Windows Powershell along the way, gawd knows where!
He was not here a few days ago and I don't have any idea where it is!
What is it and should I be worried?
Thank you
Hello
You can check this link:
How to restore Windows XP to a previous state
-
17/09/2012
Since the last automatic update, my laptop won't automatically sleep when the lid is closed. And when opened the lid of his sleep, there is no current windows; No start bar, no application. So all I can do is ctrl alt del or start L so I can restart my laptop.
I think that the last update caused this, since there was no prior dysfunction. .
popular considerations. .
JLL
Notice: I discovered that the problem was not caused by updates, but by instant replay. Disregard this message...
Thank you.
-
Since the last update when importing image directly in Lightroom, metadata display the correct focal length, but will not display any information from the lens, Lightroom reports only as 'unknown lens', the info from the lens is in the meta-data... When you change an image in LR in PS then save, lens Info appears as if by magic. This is a problem of workflow for those who could use multiple lenses on a shoot... What is the status on this issue? I shoot with Nikon D800... thnx ted-lens-metadata-field-missing-on-import?topic-reply-list[settings][filter_by]=company_promo https://feedback.photoshop.com/photoshop_family/topics/camera-raw-9-5-lens-information-aux I posted this on FB with LIGHTROOM page, they instructed me to send you. Needless to say that it is a huge problem for the workflow, and reduce my bright room isn't an option because whenever he do it takes two days to arrive, and I have no time to lose if I appreciate some type of response as soon as possible
What is the status on this issue?
The link you gave clearly indicates the status of this issue. Adobe is working on it.
-
Hi, I have 0xc0000142 error when I start the first pro after the last update, before that I had no problem playing first pro...!
Hello Gene,
You may need to check this: Re: Premiere Pro 2015 won't open after the recent update
Kind regards
Navdeep Pandey
-
crash when I try to print after the last updated
Hi all, after the last update of photoshop and lightroom cc when I try to print photoshop crashes, I try to print with another adobe application without penalty (lightroom for example) any suggestions?
Thank you
--
Arturo
Hi arturob,
Greetings!
Please re - install printer drivers and check.
Concerning
Jitendra
Maybe you are looking for
-
How to style 404 pages, etc. ?
I tried to comb the 404 pages that I get when I - type an invalid URL - have an internet connection problem - etc. Unfortunately, it seems that these 404 pages are not stored as about: pages so that it does not seem as simple to Stylize. Is it possib
-
OTP-S390 - issues with Amazon instant video bonus?
For 2 weeks now, I think that after the update to the newest firmware, I have massive problems play via the video player Sony Bluray with Amazon premium instant stuff. I did some troubleshooting and I came to the conclusion that it is either the cabl
-
Has anyone ever answer on what 'sleep of the cell' is on the A1 motorway and why he uses so the battery?
-
Vista - Error Code: 0 X 80072726 (Windows Update Service does not start)
When I run Windows Update it says that it is impossible to connect to the service because the service is not running. When I go into the Services to start the Windows Update service, it says: Windows could not start the Windows Update service on Loca
-
HP 5531:5531 want do not print on mac
I can't send or .pdf documents to print. I get blank pages when I print from my Mac.