๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ›‹๏ธ ๋ฐ์ดํ„ฐ ๋ถ„์„/๐Ÿชก SQL QUERY TEST

[Advent of SQL 2024๐ŸŽ„] ์–ธ๋”์Šค์ฝ”์–ด(_)๊ฐ€ ํฌํ•จ๋˜์ง€ ์•Š์€ ๋ฐ์ดํ„ฐ ์ฐพ๊ธฐ (Day5)

by ์œ ์Šค :) 2024. 12. 13.
๋ฐ˜์‘ํ˜•

๋‚œ์ด๋„2

๋ฐ์ดํ„ฐ๋ฆฌ์•ˆ ๋ธ”๋กœ๊ทธ GA ๋กœ๊ทธ (2022๋…„ 1์›”) ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋Š” 2022๋…„ 1์›” ๋ฐ์ดํ„ฐ๋ฆฌ์•ˆ ์›น์‚ฌ์ดํŠธ์—์„œ Google Analytics 4 (GA4)๋ฅผ ์ด์šฉํ•ด ์ˆ˜์ง‘ํ•œ ์‚ฌ์šฉ์ž ํ–‰๋™ ๋ฐ์ดํ„ฐ์ž…๋‹ˆ๋‹ค. ga ํ…Œ์ด๋ธ”์˜ page_location ์ปฌ๋Ÿผ์€ ํŽ˜์ด์ง€ ๋ทฐ, ํด๋ฆญ, ์Šคํฌ๋กค ๋“ฑ์˜ ์‚ฌ์šฉ์ž ํ–‰๋™์ด ์ˆ˜์ง‘๋œ ํŽ˜์ด์ง€ ๊ฒฝ๋กœ๋ฅผ ๋‹ด๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. page_location ์ปฌ๋Ÿผ์˜ ๊ฐ’์ด ์–ธ๋”์Šค์ฝ”์–ด('_')๋ฅผ ํฌํ•จํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๋งŒ ์ถœ๋ ฅํ•˜๋Š” ์ฟผ๋ฆฌ๋ฅผ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”. ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ์—๋Š” page_location ์ปฌ๋Ÿผ๋งŒ ์žˆ์–ด์•ผ ํ•˜๊ณ , ์ค‘๋ณต๋˜๋Š” ๊ฐ’์€ 1๋ฒˆ๋งŒ ๋‚˜์™€์•ผ ํ•˜๋ฉฐ ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌ๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

SELECT DISTINCT
  page_location
FROM
  ga
WHERE
  page_location NOT LIKE '%*_%' ESCAPE '*'
๋ฐ˜์‘ํ˜•