ID | News_Code | News_Digits |
---|---|---|
1 | GBX | 400 |
2 | NXC | 670 |
3 | LBO | 880 |
I have several codes, what I need to check that code are in News_Code
& news_Digit
section. My code is like this:
'LBX 345','NXC 670'
What I have tried:
SELECT *
FROM tblNews
WHERE News_Code IN ('LBX 345', 'NXC 670')` // But here is the problem is not only the news_code we need to consider the News_Digit as well.
2条答案
按热度按时间iezvtpos1#
You can concatenate the two columns and then compare:
If
News_Digits
is not a string data type, you can change that by casting it:gcxthw6b2#
You can join a
VALUES
virtual table (or use a real table variable, Table Valued Parameter or temp table)