Home » SQL & PL/SQL » SQL & PL/SQL » Need query
Need query [message #578064] Sat, 23 February 2013 20:47 Go to next message
mvrkr44
Messages: 64
Registered: December 2012
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 #578065 is a reply to message #578064] Sat, 23 February 2013 20:57 Go to previous messageGo to next message
BlackSwan
Messages: 22911
Registered: January 2009
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Need query [message #578081 is a reply to message #578064] Sun, 24 February 2013 06:19 Go to previous messageGo to next message
Solomon Yakobson
Messages: 2049
Registered: January 2010
Senior Member
mvrkr44 wrote on Sat, 23 February 2013 21:47
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


Hint: use analytic LAG or LEAD.

SY.
Re: Need query [message #578082 is a reply to message #578064] Sun, 24 February 2013 06:22 Go to previous message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous topics:

Michel Cadot wrote on Wed, 12 December 2012 08:45
Welcome 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:47
Welcome 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:55
Please 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:40
Please 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:16
From your previous topics:

Michel Cadot wrote on Wed, 12 December 2012 08:45
Welcome 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:55
Please 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:47
Welcome 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:57
Please 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

Previous Topic: How is naming Integrity Constants helpful?
Next Topic: Need Sql Query
Goto Forum:
  


Current Time: Sat Oct 25 13:00:12 CDT 2014

Total time taken to generate the page: 0.09148 seconds