I have two tables ...
groupid membership_list managerid
-------------------------------------
0 /0//1//2/ 2
1 /2/ 2
userid username
------------------
0 ben
1 tom
2 dan
I would like to display a table, for example, for the user "ben", which is a list of groups of which they are members that look like this:
groupid membership_list managername
---------------------------------------
0 /0//1//2/ dan
.. therefore basically replacing "manager_id" with the username for this id. I was hacked at this, but I can’t figure it out - my SQL skills are clearly a bit lacking - how can I do this?
SELECT groupid, membership_list, managerid FROM blah WHERE membership_list LIKE '%/?/%'
... as far as I know.
source
share