FORUM Everything about SQL query in lesson 130

query in lesson 130

Hi Anatoli!

I have a question about the funnel analysis query in lesson 129, namely this one:

SELECT COUNT(h.visitor_id) AS homepage_pvs, COUNT(b.visitor_id) AS book_page_pvs FROM web_analytics.pageviews h LEFT JOIN web_analytics.pageviews b ON h.visitor_id = b.visitor_id AND b.url LIKE ‘%/books/%’ AND ( b.referer_url = ‘’ OR b.referer_url LIKE ‘’ )
AND b.created_at BETWEEN h.created_at AND h.created_at + ‘30 minutes’::interval WHERE h.url = ‘’ OR h.url LIKE ‘’

My question is: Is the

“AND ( b.referer_url = ‘’ OR b.referer_url LIKE ‘’ ) “

bit necessary, given that we filter using WHERE further down? Is there a difference? They seem to give the same results