Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Tricky query

Re: Tricky query

From: James Williams <techsup_at_mindspring.com>
Date: Wed, 30 May 2001 15:13:20 GMT
Message-ID: <3b150daa.11545710@news.mindspring.com>

techsup_at_mindspring.com (James Williams) wrote:

The below works thanks to Thomas Kyte!

select * from
 (
  select source_order_nbr, ky_prem_no, dte, time,

         destination_app_id, record_type, record_sub_type, record_function,

         record_sequence_nbr,work_group_id,work_order_nbr,
         order_completion_dte,order_type,action_taken,
         employee_id,comments,last_pay_amount,
         last_pay_dte,balance_due,due_dte,
         delinquent_amount,nbr_of_cutoffs,credit_info,
  row_number() over ( partition by ky_prem_no   order by source_order_nbr,to_date( dte||time,  'mm-dd-yyhhmiss' ) DESC ) rn
  from jaw_history
  )
  where rn <= 3
  order by ky_prem_no,order_completion_dte Received on Wed May 30 2001 - 10:13:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US