select
*
from
hand_permutations
where
(left(card1,1)='A' and left(card2,1)='A')
or (left(card1,1)='K' and left(card2,1)='K')
or (left(card1,1)='A' and left(card2,1)='K')
or (left(card1,1)='K' and left(card2,1)='A')
with data1 as (
select distinct
usr_id,
date(login_time) as login_date
from
user_login_log
where
datediff(current_date,date(login_time))<=30
),
data2 as (
select
t1.usr_id,
t1.login_date as T_date,
t2.login_date as T_1_date
from
data1 as t1
left join
data1 as t2
on
t1.usr_id = t2.usr_id
and datediff(t1.login_date,t2.login_date)=-1
)
select
T_date as login_date,
concat(round(avg(T_1_date is not null)*100,2),'%') as T1_retention_rate
from
data2
group by
T_date
order by
T_date
with data1 as (
select distinct
usr_id,
date(login_time) as login_date
from
user_login_log
where
datediff('2024-10-21',date(login_time))<=30
),
data2 as (
select
t1.usr_id,
t1.login_date as T_date,
t2.login_date as T_1_date
from
data1 as t1
left join
data1 as t2
on
t1.usr_id = t2.usr_id
and datediff(t1.login_date,t2.login_date)=-1
)
select
T_date as login_date,
concat(round(avg(T_1_date is not null)*100,2),'%') as T1_retention_rate
from
data2
group by
T_date
order by
T_date
with data1 as (
select distinct
usr_id,
date(login_time) as login_date
from
user_login_log
where
datediff('2024-10-20',date(login_time))<=30
),
data2 as (
select
t1.usr_id,
t1.login_date as T_date,
t2.login_date as T_1_date
from
data1 as t1
left join
data1 as t2
on
t1.usr_id = t2.usr_id
and datediff(t1.login_date,t2.login_date)=-1
)
select
T_date as login_date,
concat(round(avg(T_1_date is not null)*100,2),'%') as T1_retention_rate
from
data2
group by
T_date
order by
T_date
with data1 as (
select distinct
usr_id,
date(login_time) as login_date
from
user_login_log
where
datediff(current_date,date(login_time))<=30
),
data2 as (
select
t1.usr_id,
t1.login_date as T_date,
t2.login_date as T_1_date
from
data1 as t1
left join
data1 as t2
on
t1.usr_id = t2.usr_id
and datediff(t1.login_date,t2.login_date)=-1
)
select
T_date as first_login_date,
concat(round(avg(T_1_date is not null),2)*100,'%') as T1_retention_rate
from
data2
group by
T_date
order by
T_date
with t1 as (
select tb_pg_act_rcd.prd_id,sum(if_snd) as exposure_cnt
from tb_pg_act_rcd
group by tb_pg_act_rcd.prd_id
)
select t2.prd_id,t2.prd_nm,t1.exposure_cnt
from tb_prd_map as t2
left join t1
on t2.prd_id = t1.prd_id
order by t1.exposure_cnt desc
limit 1
with t1 as (
select tb_pg_act_rcd.prd_id,sum(if_snd) as exposure_cnt
from tb_pg_act_rcd
group by tb_pg_act_rcd.prd_id
)
select t2.prd_id,t2.prd_nm,t1.exposure_cnt
from tb_prd_map as t2
left join t1
on t2.prd_id = t1.prd_id
order by t1.exposure_cnt desc
with t1 as (
select tb_pg_act_rcd.prd_id,sum(if_snd) as cnt
from tb_pg_act_rcd
group by tb_pg_act_rcd.prd_id
)
select t2.prd_id,t2.prd_nm,t1.cnt
from tb_prd_map as t2
left join t1
on t2.prd_id = t1.prd_id
order by t1.cnt desc