I have tbl A and tbl B as below and I would like to get their names which is seperated by comma but I am not getting in the format I am looking for.
http://sqlfiddle.com/#!2/149093/10
User: 1,2,3 ;2 - I should also get names A,B,C and then B But I am getting only A and B. How should I get their individual names who are in the column user and also satisfy the condition that 2 at least exists.Thanks in Advance.
Expected output is :
entire row with A
entire row with B
entire row with C
entire row with A
Basically 4 rows as there are 4 users in total with their name .
| USER | CATEGORY | USERNAME |
|-------|----------|----------|
| 1,2,3 | 1 | A |
| 1,2,3 | 1 | B |
| 1,2,3 | 1 | C |
| 2 | 1 | B |