Re: Fetching First Max and Second Max for each person

36 views
Skip to first unread message

jeff

unread,
Apr 4, 2014, 7:25:56 AM4/4/14
to oracle...@googlegroups.com

From my ALCATEL ONE TOUCH T’Pop

Gopakumar Pandarikkal <panda...@gmail.com> wrote:

>how about this? first normal mins are found out,then they arep minused from
>the main table again second mins are found out. first and second unioned.
>no gurantee aboit performance. still you may give it a try.
>
>with
>q1 as( select id,min(dt) dt from tab group by id,dt),
>q2 as ( select id,dt from tab minus select id,dt from q1) ,
>q3 as(select id,min(dt) dt from q2)
>
>select id,dt from q1 union select id,dt from q3
>
>regards
>Gopa
>
>On Jan 7, 2011 11:51 PM, "crocboy25" <icest...@hotmail.com> wrote:
>
>I can't use PL SQL for this task. It is for a user to use from time to
>time and the person is not tech savy. I am trying to dumb it down.
>
>
>On Jan 7, 4:56 am, sandeep kumar <kkumar.sandee...@gmail.com> wrote:
>> you can use PL SQL cursor al...
>
>> On 1/7/11, Michael Moore <michaeljmo...@gmail.com> wrote:
>>
>>
>>
>>
>>
>> > PS,
>> > this does not cove...
>> > <michaeljmo...@gmail.com>wrote:
>
>>
>> >> This should tell you what you need to do.
>>
>> >> SELECT *
>> >> FROM (SELECT do.customer_id,...
>
>> >> On Thu, Jan 6, 2011 at 12:42 PM, crocboy25 <icestor...@hotmail.com>
>wrote:
>>
>> >>> Hello Group,...
>> >>>
>persons.certified_burner_num,persons.last_name,open_burn_requests.request_d­ate,
>
>> >>> open_burn_requests.certified_burn_flag,
>> >>> open_burn_requests.acres
>> >>> ...
>> >>>
>(19870006,19870013,19870024,19870029,19870030,19870033,19870093,19870118,19­870125,19870158,19870166,19870170,19870225,19870250)
>
>> >>> order by 3)
>> >>> WHERE ROWNUM<=2;
>>
>> >>> Any help would be great appreciated.
>>
>>...
>> --http://www.google.com/profiles/kkumar.sandeep89- Hide quoted text -
>>
>> - Show quoted text -

Reply all
Reply to author
Forward
0 new messages