So I have two tables. One with stock information and one with user choice information. I am trying to query my db and have a set of results from this query where information on the user choice table is omitted from the results of the stock information.
Yet in attempting to roll this query out and refine it I have trimmed it down from one to many results, way more than there should have been, to now the correct results but its still giving me the equivlant of just doing a regular simple select without the conditions. Including the result(s) I don’t want to appear. From this query I should have all but 2 results for this test, but those 2 still show with the rest. I think Im on the right track with this query but something somewhere I am missing something.
Can someone explain to me how I did this wrong?
select distinct
stock.teamType,
stock.teamName,
stock.leagueType
from teamNames stock
left join teams user on stock.teamName not in (user.teamName)
where user.membID = 20 and stock.leagueType = 'nfl'
Try