DROP TABLE IF EXISTS SampleDBTutorials.dbo.ReferrersPerDay; //create table ReferrersPerDay for storing references from external ...

DROP TABLE IF EXISTS SampleDBTutorials.dbo.ReferrersPerDay;

//create table ReferrersPerDay for storing references from external websites
CREATE TABLE SampleDBTutorials.dbo.ReferrersPerDay
(
    INDEX idx1
    CLUSTERED(Year ASC)
    PARTITIONED BY HASH(Year)
) AS 

SELECT s_date.Year AS Year,
       s_date.Month AS Month,
       s_date.Day AS Day,
       cs_referer,
       sc_status,
       COUNT(DISTINCT c_ip) AS cnt
FROM SampleDBTutorials.dbo.WeblogsView() AS weblog
GROUP BY s_date,
         cs_referer, 
         sc_status;
English
English (United States)
Deutsch (Deutschland)
German (Germany)
Español (España)
Spanish (Spain)
Français (France)
French (France)
日本語
Japanese
한국어
Korean
Русский
Russian