GROUP BY meta_deviceId, meta_owner, number, year, month, day) smsData ON smsData.owner = callData.owner AND smsData.deviceId = callData.deviceId AND smsData.number = callData.number AND smsData.year = callData.year AND smsData.month = callData.month AND smsData.day = callData.day
GROUP BY meta_deviceId, meta_owner, number, year, month, day) smsData ON smsData.owner = callData.owner AND smsData.deviceId = callData.deviceId AND smsData.number = callData.number AND smsData.year = callData.year AND smsData.month = callData.month AND smsData.day = callData.day
INSERT INTO TABLE Android_Frequent_Contacts_Per_Month
INSERT INTO TABLE Android_Frequent_Contacts_Per_Month
SELECT owner, deviceId, number, sum(callCount) as callCount, sum(smsCount) as smsCount, sum(total) as total, year, month, getMonthStartingTime(year, month) as _timestamp
SELECT owner, deviceId, number, sum(callCount) as callCount, sum(smsCount) as smsCount, sum(total) as total, year, month, getMonthStartingTime(year, month) as _timestamp