SELECT DISTINCT C.user_id, A.wallet_id, B.kyc_type, A.limit_set_on, C.password_set_date FROM (SELECT DISTINCT wallet_id, DATE(created_at) as limit_set_on FROM wallet.wallet_limits WHERE year IN (2021, 2022) AND DATE(created_at) BETWEEN '2021-04-01' AND '2022-03-31' AND category = 'ORDER' AND ((daily_amount > 0) OR (daily_frequency > 0)))A INNER JOIN (SELECT DISTINCT wallet_id, kyc_type FROM wallet.wallet)B ON A.wallet_id = B.wallet_id INNER JOIN (SELECT DISTINCT user_ext_id as user_id, wallet_id, DATE(last_reset_attempt) AS password_set_date FROM users.users WHERE year IN (2021, 2022) AND wallet_id IS NOT NULL)C ON A.wallet_id = C.wallet_id WHERE (C.password_set_date IS NULL) OR (A.limit_set_on < C.password_set_date)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter