|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 6/26/2008 8:43:15 AM
Posts: 5,
Visits: 15
|
|
Hi,I need to compute a kpi named "Low-grade Silent Customers" which means customers that haven't use our specific service for 3 months to 1 year.In our data warehouse,we store specific service usage records in separate tables by month,and each table has more than one hundred million recodes,who can give me a smart sql?
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/29/2007 5:48:26 AM
Posts: 1,
Visits: 4
|
|
A bit late but maybe you can try to look in the following direction:
select distinct customers from month_12_table
union
select distinct customers from month_11_table
union
.....
.....
union
select distinct customers from month_3_table
minus
select distinct customers from month_2_table
minus
select distinct customers from month_1_table
minus
select distinct customers from month_0_table
Oscar
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 6/26/2008 8:43:15 AM
Posts: 5,
Visits: 15
|
|
thanks,ohuibers,
i haved solved the problem the same way as your advice
|
|
|
|