Code:
SQLStr = "SELECT PlayerName FROM PlayersInHandData AS PIHD INNER JOIN ActionsData AS AD ON PIHD.HandID=AD.HandID WHERE AD.ActionType='DealCards' AND PIHD.SeatNumber=AD.SeatNumber"
now that SQL command works, but returns multiple instances of the same PlayerName.
i tried adding a DISTINCT into the statement to stop duplicates
Code:
SQLStr = "SELECT DISTINCT PlayerName FROM PlayersInHandData AS PIHD INNER JOIN ActionsData AS AD ON PIHD.HandID=AD.HandID WHERE AD.ActionType='DealCards' AND PIHD.SeatNumber=AD.SeatNumber"
which does stop the duplicates.. but also returns the wrong results
(it seems as if it is ignoring the AND PIHD.SeatNumber=AD.SeatNumber bit)
i can easily enough just filter out all duplicate names in code.. however if its possible to do it within the SQL statement id rather do that
Is it possible to use DISTINCT on tables INNER JOIN'ed? and if so how do i group my WHERE's so that both the criteria are met.
thanks in advance
If somethings hard to do, its not worth doing - Homer Simpson