1
Answer

display results from Table were a column satisfies having only these.

Manish Parmar

Manish Parmar

3y
574
1

Would like to explian further with below example i am using MS SQL Server

I have 2 Table TableA and TableB

TableA

ID Country
1 Indonesia
2 Singapore

TableB

SupplierID TableA_ID
4 1
4 2
3 1
2 2

Now i want to select column SupplierID from TableB only where TableA_ID = 1 and 2 

The result that i want to be displayed is SupplierID = 4 

The problem that i am facing is if i use WHERE IN (1,2) condition other SupplierID are also displayed, can anyone help me how shall i put Query so i get desired results.

Please let me know if above was not clear.

Answers (1)