我使用PERCENT_RANK()函數來獲取給定數據集的百分比度量。這裏的查詢: WITH time_values AS (
SELECT
var,
(end_time - start_time) * 1.0/3600000000 AS num_hours,
PERCENT_RANK() OVER (PARTITION BY var1 ORDER BY
我試圖計算可通過不同渠道聯繫的客戶。下面的代碼會給我一個只有通過短信可聯繫的客戶的統計。 with grouping as (
select distinct
case when sms_correct_flag = 'Y' then 'Y' else 'N' end as smsable,
case when email_correct_flag = 'Y' then