|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/29/2008 4:04:39 AM
Posts: 5,
Visits: 17
|
|
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 Guru
      
Group: Forum Members
Last Login: 8/20/2008 2:31:00 AM
Posts: 53,
Visits: 10
|
|
hi, Make use of union..
Regds, sachin
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/29/2008 4:04:39 AM
Posts: 5,
Visits: 17
|
|
thanks for your reply, sachin, if i want to get the kpi of 200707, do you mean i should do it like this :
select serv_id from serv_t minus (select serv_id from cdr_t where stat_month = 200707 union select serv_id from cdr_t where stat_month = 200706 union select serv_id from cdr_t where stat_month = 200705) minus (select serv_id from serv_t minus (select serv_id from cdr_t where stat_month = 200707 union select serv_id from cdr_t where stat_month = 200706 ...... union select serv_id from cdr_t where stat_month = 200608) )
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 10/7/2008 6:20:30 PM
Posts: 136,
Visits: 11
|
|
I believe Teradata Window Based function can address your problem. Look up for OLAP functions in SQL reference manuals.
Thanks, Vinay Bagare
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/29/2008 4:04:39 AM
Posts: 5,
Visits: 17
|
|
|
Thank you,Vinay Bagare,I will find it right now.
|
|
|
|