page transition count aggregation

Asked 2 years ago, Updated 2 years ago, 38 views

The number of transitions from one page "A" to a specific page "B", "C", "D" on a monthly basis. Also, what kind of queries should I write to aggregate by device?

I would appreciate it if you could let me know.

CREATE TABLE wab_log(
  td_url text,
  td_referrer text,
  td_os text,
)

sql

2022-09-29 22:56

1 Answers

There is no description of the column, so I will answer by guessing.
When the previous page is stored in td_referer,
"From a certain page ""A"", so the last page is ""A""."
WHERE td_referer='A'

Groups by page and by device.
If the access page is td_url and the device is td_os,
GROUP BY td_url, td_os;

I'll wrap it up. (The table name was not specified, so it's appropriate.)

SELECT td_url, td_os, COUNT(*)AS td_num 
FROM test
WHERE td_referer = 'A' 
GROUP BY td_url, td_os;


2022-09-29 22:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.