I have a question because I don’t know if this is possible in MySQL alone, if it is I might restructure some tables.
1: If I have a row with this:
VARCHAR "1,2,3,4,5"
2: I do a simple sub-query:
SELECT *
FROM otherTable
WHERE id = 12
AND id NOT IN (
SELECT lists FROM firstTable
WHERE id = 12
)
Q: Instead of comparing items NOT IN the string of “1,2,3,4,5” —
Is there a way to make those values separate so you can compare it with 1 then 2 then 3, etc?
I realize this might cause 10x more work on MySQL’s part, but I’ll only be using this for one set of items at a time.
I guess its not a huge deal, I just thought there was a smarter way to do it – haha (There probably is, but A_SIMPLE_LAYOUT and DESIGN are very different things!)
I was trying to select all the users that are not assigned to a given project so that the person doesn’t attempt to add a user already in there from a drop down list (I also check this in the SQL).
I only put the ID there because I thought I had to have a Primary Key. I’ve only used PK’s and UNIQUE keys, and this has two rows that BOTH would have to be unique – maybe I should combine those into 1