I have this SQL
DECLARE @url varchar(100)
SET @url = 'http://mysite.com/%'
SELECT
[UserSessionSequenceID]
,[SiteID]
,[Referer]
,[Timestamp]
,ROW_NUMBER() over (PARTITION BY [Referer] ORDER BY referer DESC) AS sort
FROM [tblSequence]
WHERE [Referer] IS NOT NULL AND [Referer] NOT LIKE @url AND siteID = 15
Want to count unique referer - problem is that this SQL returns ALL matches and count those one by one. I only want the count for each unique referer (and still exsluding the @url with like).
How to do that?