Show pageOld revisionsBacklinksFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== SQL 4등분 rand() 함수 ====== 조심하자.. <code sql> CASE WHEN RAND() <= 0.25 THEN '1' -- 25%의 확률 WHEN RAND() <= 0.33 THEN '2' -- (1-0.25) * 33% = 24.75%의 확률 WHEN RAND() <= 0.5 THEN '3' -- (1-0.25-0.2475) * 50% = 26.25%의 확률 ELSE '4' -- 나머지 확률: 1 - (0.25 + 0.2475 + 0.2625) = 25% END </code> {{tag>data_analysis:sql rand 분할}} ~~DISCUSSION~~ data_analysis/sql/sql_rand_split_4.txt Last modified: 2025/07/07 14:12by 127.0.0.1