I’m working on a hobby program and figure there is a better way of doing this. What I have is this query here:
SELECT username
FROM users
Which returns ALL possible matches.
I then run this query:
SELECT username
FROM alreadyDone
WHERE Name='test'
Which gets me the matches that we have completed. I then just add these all to arraylists in Java and then remove the same ones through the collections interface.
I figure there is a way to get this done all though MySQL, and playing around with various joins and such, I cannot figure out which way to go. Can someone point me in the right direction?
If I understand correctly, you’re trying to find those users who are NOT in the alreadyDone table for the ‘test’.
Alternatively, you could also write this as: