OLAP function can be very handy sometimes.
and you can read about it on a developerworks
here is the link
http://www.ibm.com/developerworks/data/library/techarticle/dm-0401kuznetsov/index.html
here is the query which I have used
create view del_tmp as select SNO,VEH_REGN_NO ,row_number() over(partition by veh_regn_no) as row# from DWH.DWH_REG;
select * from del_tmp where row#>1;
select * from DWH.DWH_REG;
select count(*) from del_tmp where row# >= 2;
delete from del_tmp where row# >= 2
using query results like parameter
3 years ago
No comments:
Post a Comment