Jump to content


This topic is now archived and is closed to further replies.


Grouping results based on internal?

Recommended Posts

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 quote

Here is an example of the table and the wanted results.
ID referrer type time ip
1 XADW0124 MC 1161683434
2 XADW0124 MC 1161683464
3 XADW0124 MC 1161683484
4 XADW0124 PC 1161684425
5 XADW0139 MC 1161685322

ID  referrer      type  time            ip
3    XADW0124  MC    1161683484
4    XADW0124  PC    1161684425
5    XADW0139  MC    1161685322

Referrer        Num Quotes Filtered      Num Quotes Unfiltered
XADW0124    2                                4
XADW0139    1                                1

Thanks for the help,

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.