Need age difference between warning and critical [message #680106] |
Wed, 22 April 2020 01:22 |
|
soubalaji
Messages: 5 Registered: April 2020
|
Junior Member |
|
|
Hi Team,
I have a requirement to find the age for the warning to critical and criticl to warning.
I have a table like below
Task->Date->status
A => 20-March-2020 -> clear
A => 19-March-2020 -> Warning
A => 18-March-2020 -> Critical
A => 17-March-2020 -> Warning
A => 16-March-2020 -> Warning
A => 15-March-2020 -> Clear
A => 20-Feb-2020 -> clear
A => 19-Feb-2020 -> Warning
A => 18-Feb-2020 -> Critical
A => 17-Feb-2020 -> Warning
A => 16-Feb-2020 -> Warning
A => 15-Feb-2020 -> Clear
Need to find recent age differene between critical to warning and warning to critical as
for critical to warning:
A => 19-March-2020 -> Warning
A => 18-March-2020 -> Critical
and for warning to critical:
A => 18-March-2020 -> Critical
A => 16-March-2020 -> Warning
and i want the final output like
Task=>Warning_critical_Age->Critical_Warning_Age
A=>1=>2
will you please help to solve this ?
|
|
|
Re: Need age difference between warning and critical [message #680107 is a reply to message #680106] |
Wed, 22 April 2020 01:24 |
|
Michel Cadot
Messages: 68665 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Welcome to the forum.
Please read the OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.
Also always post your Oracle version, with 4 decimals (query v$version), as often solution depends on it.
With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.
The test case must be representative of your data. If you have several task then post a test case with several tasks...
Take care care that we have neither the same date format nor the same date language, use TO_DATE.
Have a look at LAG/LEAD functions.
[Updated on: Wed, 22 April 2020 01:28] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Need age difference between warning and critical [message #680125 is a reply to message #680122] |
Wed, 22 April 2020 12:10 |
|
Michel Cadot
Messages: 68665 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
soubalaji wrote on Wed, 22 April 2020 15:52i am really sorry for this.I am not asking you to write sql query on behalf of me.
I am excepting your guidance on this.
...
Michel Cadot wrote on Wed, 22 April 2020 08:24
Welcome to the forum.
Please read the OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.
Also always post your Oracle version, with 4 decimals (query v$version), as often solution depends on it.
With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.
The test case must be representative of your data. If you have several task then post a test case with several tasks...
Take care care that we have neither the same date format nor the same date language, use TO_DATE.
Have a look at LAG/LEAD functions.
If you are REALLY sorry then post what we requested several times.
|
|
|