Duplicate content can be removed using ROW_NUMBER() and PARTITION() - in this example, we'll show how to do it:
CREATE VIEW views.ga_transactions_nodups
AS
SELECT
transactionId,
tdate,
thour,
source,
medium,
campaign,
keyword,
transactions
FROM
(
SELECT row_number() over (partition BY transactionId ORDER BY tdate,
thour ASC) rnum
,transactionId,
tdate,
thour,
source,
medium,
campaign,
keyword,
transactions
FROM views.ga_transactions ) a WHERE a.rnum=1
Comments
0 comments
Please sign in to leave a comment.