Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI,
I have a table called logins with cust_id and date, may be several rows with the same cust_id and date (several logins in the same day)
in the script - i`m trying to create a table that holds for each cust_id the dates he did not login from his first login until today.
400K +/- customers and looking on a 3 years period so i cant use cartesian product and then filter out the non relevnt.
how can i do this?
Why not a cartesian product? On the first glance it looked quite feasible: 400K * 3 years * 365 days are approximately 140M of records but it are just two fields and therefore it should go rather fast and not need too much of resources ... and in a following step a flag-value with a mapping could be following.
Beside this do you are really sure that you will need all these records (all the existing and the missing ones mean that you have ALL records)? Of course there are alternatives with loops but I don't think they will be easier and the result will be also to have all records (probably in one table because a split into several tables doesn't seemed to be beneficial).
- Marcus