
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An sql query example for archiving and cleaning data in a data warehouse. The query selects data from a table named [ww tier_1] with a fiscal quarter condition, groups it, and orders the results. It also includes commands for archiving old data into a new table, deleting the old data, and counting the number of records before and after the archiving process. The document also includes a query for selecting data from another table named dim_ba_product_ref.
Typology: Thesis
1 / 1
This page cannot be seen from the preview
Don't miss anything!
select fiscal_quarter, count() as Count from [WW TIER_1] with (nolock) group by fiscal_quarter order by fiscal_quarter select count() from [WW TIER_1] where fiscal_quarter < 'FY15Q1' -- Select * into [Archive_WW TIER_1_17072017] from [WW TIER_1] where fiscal_quarter < 'FY15Q1' select count() from [Archive_WW TIER_1_17072017] delete from [WW TIER_1] where fiscal_quarter < 'FY15Q1' select count() from [WW TIER_1] where fiscal_quarter >= 'FY15Q1' -- select * from DIM_BA_PRODUCT_REF