Sorry for the long title.
I have a statement which needs to grab all the columns from one row from BinConfig:
SELECT *
FROM BinConfig WITH(NOLOCK)
WHERE IssuerKey = @IssuerKey
But I also need to grab a single column from one row from CardRangeGroup
also based on that IssuerKey
column.
What I've tried:
SELECT
BinConfig.*, CardRangeGroup.Name
FROM
BinConfig
JOIN
CardRangeGroup WITH(NOLOCK)
WHERE
@IssuerKey = BinConfig.IssuerKey
AND @IssuerKey = CardRangeGroup.IssuerKey
Which gives me a syntax error near WHERE
. I've tried to find resources online, but everywhere I look I can't find anything explaining how to select rows based on a passed in variable. Any help?