I want to count distinct value that exist in 2 columns like
Column A Column B
1 5
5 6
4 1
5 4
How can I get the answer : 4 as there are only four distinct values in both columns.
Can you please guide me how to apply in query (Distinct count in Club1 and Club2)
SELECT Count(DISTINCT registrationevent.RegistrationNo) AS TotalRegistration, Sum(If((registrationevent.Spouse = 1), 1, 0)) AS CoupleRegistration, Count(DISTINCT registration.Club) AS Club1, count(Distinct registration.SpouseClub) as Club2 FROM (registrationevent) JOIN registration ON registrationevent.RegistrationNo = registration.RegistrationNo