How to order by the last two dates?
HelloI try to get the result in a table with the highest of the two dates. First date is a date created_on, the second date is "updated_on". I want to display the rows ordered by the last day between these two.
I've tried this application without result.
SELECT
name "Nom",
updated_on, created_on,
greatest (updated_on, created_on) latest
FROM doclib_documents
order by latest desc
Below is an example of the table data.Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('readme.txt',to_timestamp('08/03/2010 15:16:56','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('12/03/2009 11:22:41','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('doc_library_readme_0.92.txt',to_timestamp('12/02/2010 13:32:30','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('12/03/2009 11:26:14','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('01_informatique.pdf',to_timestamp('10/02/2010 13:49:34','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('12/03/2009 16:29:00','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('readme.txt',to_timestamp('08/03/2010 15:16:56','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('16/02/2010 11:40:16','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('dataguardproblem.txt.txt',to_timestamp('03/03/2010 11:19:44','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('16/02/2010 11:41:03','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('f110.sql',to_timestamp('03/03/2010 10:59:08','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('10/02/2010 13:44:45','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('1.jpg',to_timestamp('08/03/2010 14:22:00','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('08/03/2010 14:17:42','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('dads.conf',to_timestamp('03/03/2010 11:19:56','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('09/02/2010 11:19:30','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('1.doc',to_timestamp('10/02/2010 13:49:46','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('09/02/2010 11:20:28','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('1.doc',to_timestamp('15/02/2010 16:08:06','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('09/02/2010 11:33:02','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('dataguardproblem.txt.txt',to_timestamp('03/03/2010 10:57:52','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('09/02/2010 11:36:15','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('access.rtf',to_timestamp('10/02/2010 13:38:25','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('09/02/2010 12:10:57','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('temp.sql',to_timestamp('12/02/2010 14:43:58','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('11/02/2010 09:59:56','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('evv_E022_doublons.txt',to_timestamp('15/02/2010 15:55:02','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('12/02/2010 15:59:45','DD/MM/RR HH24:MI:SSXFF'));
Insert into "table_export" ("Nom",UPDATED_ON,CREATED_ON) values ('evv_E022_doublons.txt',to_timestamp('15/02/2010 16:05:58','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('12/02/2010 16:00:25','DD/MM/RR HH24:MI:SSXFF'));
Thanks for you help!Christian
It does not work for me
select t.*, greatest(updated_on, created_on) latest_date
from "table_export" t
order by latest_date desc
Tags: Database
Similar Questions
-
I've lost the last two digits of my valid key for xp pro sp2 and notebook, how do I get the key and support? where?
Hi Jonathan,.
Please go to the Microsoft Community Forums.After the description of the question, I understand that you have lost the last 2 digits of the product key.Let me go ahead and help you with the issue.Please answer these questions, which will help us to help you best.1. How did you get the product key?2. the operating system come preinstalled on the computer?I suggest you for the link and check if that helps:How to identify, locate, and replace a product keySee also:
I hope this helps. If you have any other queries/issues related to Windows, write us and we will be happy to help you further. -
How to find the last update date, time and user of the file field peoplecode
How to find the last updated date time fields of peoplecode records?
Thank you.We can check the update date-time using the following query
SELECT LASTUPDDTTM IN THE PSPCMPROG WHERE OBJECTVALUE1 LIKE "RECNAME" AND OBJECTVALUE2 AS "FIELDNAME".
-
How to use GREP expression to group the last two words of a paragraph?
Hi guys, I'm dealing with a document that is riddled with the orphan and want to use GREP to get rid of them all.
I found this thread talking about how to group all the last 10 characters. But in my language, you can have up to 4 words together (almost a third of the sentence!) and still not break the limit of 10 characters. So if I use this expression, a sentence cut in half way, which make the whole paragraph looks horrible. I also tried the (\s\w+)? $ expression, but he left a few intact orphans (No. very random, model at all).
So is there any other expression that can make the last 2 words of any paragraph together like glue stick?
(\H+?\h ?) {2} $
(^/)
-
How do you find the last time an old hotmail address was used... especially if you can't remember the exact password?
original title: old hotmail addressHow do you find the last time an old hotmail address was used... especially if you can't remember the exact password?
Good enough if you can't on the account and you can't prove it is yours in order to regain access (via password self-service reset, etc)-then you won't know anything about the account.
-
Extract the last opening date of session using Groovy?
Is it possible to extract the last opening date of session of the user via a Groovy script? I went through the scheme, but I don't have the slightest idea how to begin to know where there.
Ideally, I'd end up with a list that displays the name of each user connection and date of last connection.
Try this:
msg = new StringWriter()
SS = server. SecurityService;
FMS = server. HaMembershipService.getHostName)
Msg. Append ("FMS; Foglight ID; Foglight roles; lastLogonTS; logonCount; statusDesc; logonType; createdTS\n')
(user) {ss.findAllUsers ()}
Msg. Append (FMS). Append(";")
Msg. Append (User.Name). Append(";")
List =]
for (secRole in ss.getAllRolesForUser (user.name)) {list += secRole.name}
Msg. Append("["). Append (List.Join(",")). Append("];")
Msg. Append (User.lastLogonTS.ToString ()). Append(";")
Msg. Append (User.logonCount.ToString ()). Append(";")
Msg. Append (User.getStatusDesc ()). Append(";")
If (User.isExternal ()) {msg.append ("external ;")}
Else {Msg.Append ("Internal ;")} ")}
Msg. Append (User.createdTS.ToString ()). Append ("\n")
}
return msg;
-
the last two days, I get an error message and Firefox does not open. I'm on 9.0
The last two days, Firefox will not load. I get an error screen. I'm on 9.0
Thanks for the help. All is well in Tennessee!
Gary
-
How can I stop the last post showing when I want to send this person a new Imessage. I don't want an old conversation appears constantly when I am a Messenger contact. I have an Iphone 5s
I don't know, but let me see if I understand what you're asking. You do not want to see the thread you have with a particular contact when you go to send them another message? The only way to do this is to remove the previous message thread. If you send a message to someone that you already have a thread of conversation with, it will continue to post in this thread. There is no such thing as having multiple threads with the same person. All conversations with the same person would remain in the same thread, unless you remove the previous discussions. If you delete your previous conversation, when you go to start a new conversation, he won't have any of the other answers.
-
For the last two months - easrly November, when stopped down, I saw 10 message updates are being installed. This follow-up installation of Office 2010 (download from Web site), who bought Office 2007 earlier this year, and by choosing to take the free update promised for 2010.
On the control, I find that whenever all ten updates failed to install (error code 646)
Concered updates are KB2202188; KB982726; KB2289161; KB2289078; KB2413186; for Office 2010
and KB2345000 - Word 20120.
KB2409055 - 2010 Editor;
KB2289116 - Social connector;
KB2431831 - knitting 9;
KB2433299 A Note;
Any thoughts there?
Steve L
A KB was created for 646 error code that appears during the installation of the updates of Microsoft Office. The KB includes an automatedMicrosoft fix 50461 that corrects the problem. Look at the following KB:http://support.microsoft.com/kb/2258121http://snipurl.com/164ypp>
Suggest you download and save the fix it.
Then close all open programs and browsers before running MSFix it 50461.msi.
-
FOR THE LAST TWO WEEKS IVE HAS BEEN IMPOSSIBLE TO OPEN ANY EMAIL WHICH IS LOCATED IN ANY OF MY HOTMAIL FOLDERS. ALSO, I CAN NOT OPEN HOTMAIL WHICH IS IN THE AREA SENT, WHENEVER I TRY THE SERVER BRINGS BACK ME TO THE HOTMAIL INBOX.
original title: I CANT ACCESS ANYTHING THAT HASBEN PLACE IN MY RECORDS or IN THE SENT BOX IT JUST FLIPS BACK to MY RECEIVING HOTMAIL InboxHello
Given that the problem is related to hotmail, I suggest you to post the question in the forums and check them off below if it helps:
http://windowslivehelp.com/solutions.aspx?ProductID=1It will be useful.
-
How can I reset the time and date on Windows Vista?
How can I reset the time and date on Windows Vista
http://www.ehow.com/how_2056384_change-date-time-Windows-Vista.html
http://www.Vistax64.com/tutorials/114989-date-time-change.html
Read the information in one of the links above.
See you soon.
Mick Murphy - Microsoft partner
-
Photoshop don't complete installation simply says "FINISH" for the last two hours
I JUST PURCHASED LIGHTROOM AND PHOTOSHOP CC. LIGHTROOM DOWNLOAD HOWEVER PHOTOSHOP IS JUST SAYING "FINAL" for THE LAST TWO HOURS?
Mac or Windows and EXACTLY what version of the operating system?
Recent Mac AND Windows operating systems have been known to cause problems "weird."
Please read https://forums.adobe.com/thread/1499014
-try some steps such as changing browsers and disable your firewall
-also clear the cache of your browser if you start with a fresh browser
-check the file hosts for blocked entries https://forums.adobe.com/thread/1912777
http://myleniumerrors.com/installation-and-licensing-problems/creative-cloud-error-codes-w ip.
https://helpx.Adobe.com/creative-cloud/KB/creative-cloud-desktop-application-failed.html
http://helpx.Adobe.com/creative-cloud/KB/failed-install-creative-cloud-desktop.html
-
Hi there from Hamburg/Germany. Since the last two updates of the CC, Photoshop crashes 95% when I work with masks. This gets really annoying when you know that I have about 120 photos to retouch to a customer. Any ideas what's happening here? Never had this problem before. Now, every time I create a layer mask, or try to work on a Photoshop freezes completely, forcing me to restart and (most of the time unless I have record EACH step) start of a scratch. Which is pretty much annoying... any suggestions?
Move on to the Discussion of Photoshop
-
How can I make the last edition. I already have Adobe Creative Cloud?
How can I make the last edition. I already have Adobe Creative Cloud?
Is that what you mean?
Previous through Cloud http://helpx.adobe.com/creative-cloud/help/install-apps.html#previous
- and if you have Cloud application manager 2015 https://forums.adobe.com/thread/1906752 of difference
-
How can I get the list of data stores in a cluster data store?
How can I get the list of data stores in a cluster data store? I mean the command line option.
Hello
by command line, you mean PowerCLI?
If so, you can display data with this warehouses:
Get-DatastoreCluster-name DSClustername | Get-Datastore
Tim
Edit: Moved the thread to the PowerCLI community
Maybe you are looking for
-
Satellite L670-105 - HDD compatibility
I had to repair my Satellite L670-105 system partition, I believe that the HARD drive is MK6475GSX, as some groups failed, I think it would be prudent to replace the disk. Then I think to install a MQ01ABD100 with or without SSD addon (in any case th
-
EliteBook 840: unable to boot from usb flash
Hello: I'm tempted to boot from USB drive to install a new version of Windows 7. When I press F9, I have only two startup options: -Computer portable hard drive -Computer laptop Ethernet The USB boot option do not appear. My BIOS Version is: 01.04 wo
-
Rename files photo for a slide show
When I created a card SD of a photo album to show the slideshow on another PC or my digital photo frame, photos get all out of sequence. I carefully regulated the photos in chronological order, move some more strange files and phone in order and I h
-
When I open first the Jabber client on my desktop (Windows), it is very large. It seems that it can only be shrunk down so much. There are really a lot of space lost on this client. Also when I make a call, there is a large white space on the left
-
BlackBerry 10 can not send emails to someone, not in the contacts list
Brand new here and searched this forum and elsewhere for this problem, but the gaps came. I got my Z10 launch day at the Canada and he likes most of the time. Most of the questions I had were actually lack of Telus. (Implemented my Telus email accoun