this is my first question on stackoverflow please feel free to edit in proper formate, I want to write a query in mysql that return unique list of all searched ids from a table that contain array of ids.
For example I have a table(event_tbl
) which has three columns
- id
- peopleWhoWillAttend
- eventName
Now lets say I have three row of these three value
id peopleWhoWillAttend eventName
1 [1] 'event1'
2 [1,2,3] 'event2'
3 [3] 'event3'
Now if I search for peopleWhoWillAttend [1,3](this may be longer array not only [1,3]) it should give the result
id eventName
1 'event1'
2 'event2'
2 'event2'
3 'event3'
Or lets say I have a row of these value
id peopleWhoWillAttend eventName
1 [1,2,3] 'event2'
Now select in such a way that should give the result
id peopleWhoWillAttend eventName
1 1 'event2'
1 2 'event2'
1 3 'event2'