Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Last_day function

V prasadOct 10 2012 — edited Oct 10 2012
create table test11(tno number(8), tdate date, tval varchar2(55));
insert into test11 values(1,'15-JAN-2011', 'JSKD');
insert into test11 values(2,'31-JAN-2011', 'JSKD'); --------------
insert into test11 values(3,'14-MAY-2011', 'JSKD');
insert into test11 values(4,'31-MAY-2011', 'JSKD');-----------------
insert into test11 values(5,'15-JUN-2011', 'JSKD');
insert into test11 values(6,'30-JUN-2011', 'JSKD');--------------
insert into test11 values(7,'31-AUG-2011', 'JSKD');-----------
insert into test11 values(8,'20-NOV-2011', 'JSKD');-----------


i want output as

tno   tdate                    tval
2      31-JAN-2011         'JSKD'
4      31-MAY-2011        'JSKD'
6      30-JUN-2011        'JSKD'
7      31-AUG-2011        'JSKD'
8      20-NOV-2011         'JSKD'

i tried SELECT tno, MAX(TDATE) FROM TEST11 
group by to_char(tdate,'MMYYYY'),tno
This post has been answered by jeneesh on Oct 10 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 7 2012
Added on Oct 10 2012
13 comments
366 views