Today marks a day in history: the first time I had a real and practical use for a SQL Cross Join. Why is this special? I _really_ thought I'd never use a cross join. I mean, I've used "WITH CUBE," Access CrossTabs, and more Case, Convert, Cursors, and Casts than I care to admit. But nary a cross join.
The task? I recently saw that Netscape 8 was released; IE 7 is heating up on the internal circuit; and all the while Firefox has gained a lot of ground. I wanted a way to do my own site metrics; I have the session data, the challenge was to organize and present it..
I decided to create a UserAgents table that contains the signatures for the browsers I care about, containing things like descriptions, regex strings, etc ... currently I've got about 7 rows. Table 2 contains the session data.
I figured that rolling up the data by month was a reasonable approach ... so in addition to a lot of group-bys, counts, left and inner joins, at long last a real use for the cross join by matching all my User Agents by aggregated session data. The results can be seen on my home page.
So, when was your first Cross Join?