20 lines
428 B
SQL
20 lines
428 B
SQL
select
|
|
s.distinct_id,
|
|
count(distinct w.visit_id)
|
|
from
|
|
website_event as w
|
|
join
|
|
session as s
|
|
on s.session_id = w.session_id
|
|
where
|
|
w.website_id = '16e7d807-4db5-45fd-92a9-27393445a153'
|
|
and w.event_type = 1
|
|
and w.created_at between '2025-10-13' and '2025-10-19'
|
|
and s.distinct_id is not null
|
|
and substring(s.distinct_id similar '%#"@%#"' escape '#') not in ('@oceanbox.io')
|
|
group by
|
|
s.distinct_id
|
|
order by
|
|
count desc
|
|
;
|