I have a table similar to this:
memberID | clubIDs | clubRegistrationDates ...
--------------------------------------------------------------------
2 3,4,10,2 2010,2011,2015,2014 ...
3 2,1,5,6 2015,2000,2005,2010 ...
4 3,2 2014,2014 ...
Meaning of a row is, for example: member 2 was registered to club 3 in 2010, was registered to club 4 in 2011 and so on...
So the query I want to get is to get any member who is a member of club 2 since 2014, so this query should get me members 2 and 4. I already have an sql but it is not connected to year parameter which is:
SELECT clubID, clubName,
(SELECT count(*) FROM members WHERE FIND_IN_SET('2',clubIDs) AND status='1' AND memberTypeID='2') AS activeNumber,
(SELECT count(*) FROM members WHERE FIND_IN_SET('2',clubIDs) AND status='0' AND memberTypeID='2') AS inactiveNumber
FROM clubs;
So I need to get club 2's index from clubIDs column and use it for clubRegistrationDates column. Any help is appreciated, thanks in advance.
2(as integer) not"2"(as string) and may be put> 0afterFIND_IN_SET