How to complete this query? [message #526491] |
Tue, 11 October 2011 05:07 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/8411417bcaaf0fe2f39c3e282b0429cc?s=64&d=mm&r=g) |
m3nhaq
Messages: 20 Registered: September 2011 Location: Pakistan
|
Junior Member |
|
|
Hello Friends!
Kindly help me to complete this query.
select t.employee_code,
(t.first_name || ' ' || t.last_name) name,
add_months(t.date_of_joining, 120) as mature_date
from employee t, employee_type et
where et.employee_type = t.employee_type
AND et.description = 'REGULAR'
AND mature_date >= '11-oct-2011'
AND ET.POST = 1
AND T.POST = 1;
I am adding 120 months in employee join date and checking is Employee maturity date grater than today date or not. I need to show only 2 fields as I want to use this query in LIST items.
Thanks
[Updated on: Tue, 11 October 2011 05:13] by Moderator Report message to a moderator
|
|
|
Re: How to complete this query? [message #526495 is a reply to message #526491] |
Tue, 11 October 2011 05:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68673 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
select t.employee_code,
(t.first_name || ' ' || t.last_name) name
from employee t, employee_type et
where et.employee_type = t.employee_type
AND et.description = 'REGULAR'
AND add_months(t.date_of_joining, 120) >= To_date('11-10-2011','DD-MM-YYYY')
AND ET.POST = 1
AND T.POST = 1;
Regards
Michel
|
|
|