
September 13th, 2005, 09:49 PM
|
|
Registered User
|
|
Join Date: Sep 2005
Posts: 1
Time spent in forums: 12 m 24 sec
Reputation Power: 0
|
|
max date from a group of records
Hello all,
I am trying to select (and then insert into a table) the following:
select policy_number,max(policy_date_time) as maxdate,policy_form,county,protection_class,constr uction_type,occupancy,
amt_of_ins,liab_amt,med_pay_amt,ded_amt,rc_acv_bld g,rc_acv_contents,protective_device,
primary_loc
from fact_policy_ap
group by policy_number
having max(policy_date_time)
-- and of course, it does not work. What I have is a group of many records per policy_number that I need to just "grab" the record with the maximum policy_date_time..??? Any help\suggestions are appreciated.
|