hi guys
i have two columns in one table in both time is diffent i need the differnce of time and date between that and store in third column how can i do this i have used that format 21/10/2009 01:17 and i am using oracle as back end database
time difference
Moderator: General Moderators
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: time difference
I can't understand the need to store the result in a new column it if you're already storing the two dates used for the calculation
But it's as simple as date1 - date2
If you have
Then
But it's as simple as date1 - date2
If you have
Code: Select all
CREATE TABLE RCD_FILE_TREE
(
FILE_ID NUMBER NOT NULL,
FILE_TYPE VARCHAR2(16 BYTE) NOT NULL,
FILE_NAME VARCHAR2(64 BYTE) NOT NULL,
FILE_PARENT_ID NUMBER,
CREATED_ON DATE DEFAULT SYSDATE,
LAST_UPDATED_ON DATE
)
Code: Select all
SELECT LAST_UPDATED_ON - CREATED_ON AS DAYS_INTERVAL
FROM RCD_FILE_TREE
WHERE FILE_ID = 1
Re: time difference
thx dear i resolved my query with ur help