Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #2

Open
kumars92 opened this issue Aug 9, 2022 · 1 comment
Open

Test #2

kumars92 opened this issue Aug 9, 2022 · 1 comment

Comments

@kumars92
Copy link

kumars92 commented Aug 9, 2022

No description provided.

@pratik221b
Copy link

Is this correct?

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

)
GROUP BY 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants