I am trying to do an update of values from one stock table into another stock table. However, some of the values are getting copied over as NULL because that stock does not exist in the source table. I thought that INNER JOIN only looked at the values that were shared between both tables. My allStocks table has a lot more stocks than divStocks, but there are a few stocks in divStocks that don't exist in allStocks. I just want to copy the prices over from allStocks into divStocks and not overwrite any prices with NULL.
This is my current query:
UPDATE `divStocks` ds INNER JOIN `allStocks` als ON
`ds`.`tickerSymbol` = `als`.`tickerSymbol` SET `ds`.`price` =
`als`.`price`, `ds`.`priceAsOf` = `als`.`priceAsOf`;