neilmunn Posted October 25, 2006 Share Posted October 25, 2006 I have in a database which stores insurance quote requests.I want 2 queries that count the number of quotes by each referrer, grouping quotes made within a 10 minute period as 1 quoteHere is an example of the table and the wanted results.TABLEID referrer type time ip1 XADW0124 MC 1161683434 82.7.164.592 XADW0124 MC 1161683464 82.7.164.593 XADW0124 MC 1161683484 82.7.164.594 XADW0124 PC 1161684425 62.173.110.625 XADW0139 MC 1161685322 195.137.84.105RESULTID referrer type time ip3 XADW0124 MC 1161683484 82.7.164.594 XADW0124 PC 1161684425 62.173.110.625 XADW0139 MC 1161685322 195.137.84.105ANDReferrer Num Quotes Filtered Num Quotes Unfiltered XADW0124 2 4XADW0139 1 1Thanks for the help,Neil Link to comment https://forums.phpfreaks.com/topic/25065-grouping-results-based-on-internal/ Share on other sites More sharing options...
fenway Posted October 26, 2006 Share Posted October 26, 2006 Intersting question... if it were by day/month, this would be relatively easy, since you could either use a sub-query or use a derived table; however, I'm stumped on how to generate 10-minute period bins... maybe with a self-join? I'll have to think about it. Link to comment https://forums.phpfreaks.com/topic/25065-grouping-results-based-on-internal/#findComment-114923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.