[SQL๋ฌธ์ œํ’€๊ธฐ - Advent of SQL 2025 ๐ŸŽ…] A/B ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•œ ๋ฒ„ํ‚ท ๋‚˜๋ˆ„๊ธฐ 1

silver's avatar
Dec 20, 2025
[SQL๋ฌธ์ œํ’€๊ธฐ - Advent of SQL 2025 ๐ŸŽ…] A/B ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•œ ๋ฒ„ํ‚ท ๋‚˜๋ˆ„๊ธฐ 1

๋ฌธ์ œ

๋‚ด๊ฐ€ ์ž‘์„ฑํ•œ ์ •๋‹ต

MySQL, PostgreSQL, SQLite

select distinct customer_id, case when customer_id%10=0 then 'A' else 'B' end bucket from transactions order by 1;
Share article

silver