First off I am using MySQL 5.0.96. (always forget to mention that)
I have two tables(TMP_VIN_STOCK
and newvehicles
) I load TMP_VIN_STOCK
with our current inventory of vehicles daily.
newvehicles
is our currently listed vehicles on our website table.
I want to find results in newvehicles
that are NOT in TMP_VIN_STOCK
. (So I can remove them from website because we sold them)
TMP_VIN_STOCK.name
and newvehicles.stocknum
are each tables stock number column.
TMP_VIN_STOCK.name
has only single values of a stock number
newvehicles.stocknum
can have multiple values separated by commas in it. (Same exact vehicle just multiple stock numbers)
Example:
TMP_VIN_STOCK table
- K12049
- S12040
- T12020
newvehicles table
- S12018, S12039, S12040
- Y13068, Y13093
- T12020
How can I find out what stock numbers are not in TMP_VIN_STOCK but are in newvehicles?