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 = ‘https://www.bindle.com/’ OR b.referer_url LIKE ‘https://www.bindle.com/?%’ )
AND b.created_at BETWEEN h.created_at AND h.created_at + ‘30 minutes’::interval WHERE h.url = ‘https://www.bindle.com/’ OR h.url LIKE ‘https://www.bindle.com/?%’

My question is: Is the

“AND ( b.referer_url = ‘https://www.bindle.com/’ OR b.referer_url LIKE ‘https://www.bindle.com/?%’ ) “

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

WRITE A REPLY