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
SELECT TRANSACTION_COUNT, COUNT(VISIT_DATE) AS VISITS_COUNT
FROM
(
SELECT A.USER_ID, A.VISIT_DATE, SUM( CASE WHEN B.TRANSACTION_DATE IS NULL THEN 0 ELSE 1 ) AS TRANSACTIONS_COUNT
FROM VISITS A LEFT JOIN TRANSACTIONS B ON A.USER_ID=B.USER_ID AND A.VISIT_DATE=B.TRANSACTION_DATE
GROUP BY 1,2
Activity
pratik221b commentedon Jul 15, 2023
Is this correct?
SELECT TRANSACTION_COUNT, COUNT(VISIT_DATE) AS VISITS_COUNT
FROM
(
)
GROUP BY 1