Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
countIf 조합자의 사용 예시
If
count
countIf
CREATE TABLE login_attempts( user_id UInt32, timestamp DateTime, is_successful UInt8 ) ENGINE = MergeTree ORDER BY (); INSERT INTO login_attempts VALUES (1, '2024-01-01 10:00:00', 1), (1, '2024-01-01 10:05:00', 0), (1, '2024-01-01 10:10:00', 1), (2, '2024-01-01 11:00:00', 1), (2, '2024-01-01 11:05:00', 1), (2, '2024-01-01 11:10:00', 0); SELECT user_id, countIf(is_successful = 1) AS successful_logins FROM login_attempts GROUP BY user_id;
is_successful = 1
┌─user_id─┬─successful_logins─┐ 1. │ 1 │ 2 │ 2. │ 2 │ 2 │ └─────────┴───────────────────┘
If 조합자
이 페이지가 도움이 되었나요?