| Need query [message #578064] |
Sat, 23 February 2013 20:47  |
 |
mvrkr44
Messages: 11 Registered: December 2012
|
Junior Member |
|
|
I have a LIC table
LIC_id Lic_st_dt Lic_to_dt
1 10-jun-2011 10-Jun-2012
1 11-Jun-2012 11-Jun-2013
2 09-Jun-2009 10-Jun-2010
2 10-Jun-2011 10-Jun-2012
2 11-Jun-2012 10-Jun-2013
3 01-Jan-2009 31-Dec-2010
3 01-Jan-2011 31-Dec-2011
3 01-jan-2013 31-Dec-2014
I need the query to get the which policy has not renewed on time
ex: 2,3 LIC_id have not renewed the policy on time...
so i need the query to get the lic_id's which are having the more than 1 day bewtween the to date and from date of the renewal policy
|
|
|
|
|
|
| Re: Need query [message #578081 is a reply to message #578064] |
Sun, 24 February 2013 06:19   |
Solomon Yakobson
Messages: 1404 Registered: January 2010
|
Senior Member |
|
|
mvrkr44 wrote on Sat, 23 February 2013 21:47so i need the query to get the lic_id's which are having the more than 1 day bewtween the to date and from date of the renewal policy
Hint: use analytic LAG or LEAD.
SY.
|
|
|
|
| Re: Need query [message #578082 is a reply to message #578064] |
Sun, 24 February 2013 06:22  |
 |
Michel Cadot
Messages: 54236 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
From your previous topics:
Michel Cadot wrote on Wed, 12 December 2012 08:45Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.
With any SQL or PL/SQL question, please, Post a working Test case: create table 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.
...
Michel Cadot wrote on Wed, 12 December 2012 08:47Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.
With any SQL or PL/SQL question, please, Post a working Test case: create table 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.
...
BlackSwan wrote on Mon, 28 January 2013 06:55Please read and follow the forum guidelines, to enable us to help you:
http://www.orafaq.com/forum/t/88153/0/
BlackSwan wrote on Sun, 24 February 2013 03:40Please read and follow the forum guidelines, to enable us to help you:
http://www.orafaq.com/forum/t/88153/0/
...
Michel Cadot wrote on Sun, 24 February 2013 08:16From your previous topics:
Michel Cadot wrote on Wed, 12 December 2012 08:45Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.
With any SQL or PL/SQL question, please, Post a working Test case: create table 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.
...
BlackSwan wrote on Mon, 28 January 2013 06:55Please read and follow the forum guidelines, to enable us to help you:
http://www.orafaq.com/forum/t/88153/0/
Michel Cadot wrote on Wed, 12 December 2012 08:47Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.
With any SQL or PL/SQL question, please, Post a working Test case: create table 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.
...
BlackSwan wrote on Sun, 24 February 2013 03:57Please read and follow the forum guidelines, to enable us to help you:
http://www.orafaq.com/forum/t/88153/0/
In addition, we don't do homework.
Post what you already tried and where you are stuck and we help you to go further.
...
And find a more meaningful title than your stupid "need query" or "need sql query".
Regards
Michel
[Updated on: Sun, 24 February 2013 06:25] Report message to a moderator
|
|
|
|