If I've got:
Table: users
ID USERNAME EMAIL
1 syeargin st*****@yeargin.com
2 bwalkerton be**********@aol.com
3 rrandall rr@aol.com
....
Table: committees
ID COMM_NAME MEMBERS
1 legislative syeargin, bwalkerton
2 diversity syeargin, rrandall
3 executive syeargin, rrandall, bwalkerton
....
How can I write a query that follows the logic: Return all 'EMAIL'
values where 'COMMITTEE' is "legilsative"?
I've tried
SELECT COMM_NAME, EMAIL
FROM users INNER JOIN committees ON FIND_IN_SET(users.USERNAME,
members)
WHERE COMM_NAME = "legislative"
ORDER BY USERNAME ASC
But it only returns:
USERNAME EMAIL
syeargin st*****@yeargin.com
Or whatever the first value is. Any ideas?
---
Stephen Yeargin
st*************@gmail.com