You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On question 3 of Text Confirmation problem, your join predicate ignores the fact that a user can send confirmation on both the first day of sign up and second day of sign up.
-- dialect: MySQLSELECTe.user_idFROM Email AS e
JOINTextAS t
ONe.user_id=t.user_idAND DATEDIFF(t.ts, e.ts) =1WHEREt.action='CONFIRMED';
A more accurate answer would be to only get the first date the user sent a confirmation and then perform a join and do a date comparison.
-- dialect: PostgreSQL
with first_confirm as (
select
user_id,
ts,
row_number() over (partition by user_id order by ts) as rn
fromtextwhere action ='CONFIRMED'
) selecte.user_idfrom email e
join first_confirm f one.user_id=f.user_idwheref.rn=1and cast(f.tsasdate) - cast(e.tsasdate) =1
The text was updated successfully, but these errors were encountered:
On question 3 of Text Confirmation problem, your join predicate ignores the fact that a user can send confirmation on both the first day of sign up and second day of sign up.
A more accurate answer would be to only get the first date the user sent a confirmation and then perform a join and do a date comparison.
The text was updated successfully, but these errors were encountered: