I have two tables.
I need to select rows in one table based on the number of times a common field occurs in the other table.
Table 1: Exceptions, Common field: SymbolID
Table 2: StockHist, Common field: SymbolID
SELECT SymbolID FROM Exceptions
WHERE Count(Exceptions.SymbolID) in StockHist is less than or equal to 5