My query is as follows:
I have 2 Tables, Table A is TCLUSTERS and Table B is SCLUSTERS.
Columns in Table A - T_Code, T_Description & in Table B - S_Code & S_Description.
All I have to do is display only those rows from Table B which have S_Code mapping to T_Code from Table A i.e. all S must have a T. If S do not have a T, then they have to be omitted. What is the logic I should use in my SQL to display the same.
Hope I was able to explain what I am looking for?
Thanks in advance,
Based on your description this sounds like a simple Inner Join.
You should give more details, maybe some rows plus estimated result.
Thanks for the prompt reply Dieter.
The logic is this.. TCLUSTERS has all the information about TRADING Companies, while SCLUSTERS holds all the STRINGS. Each String should have a Trading Company. The total rows is about 8000 (small table). But there are only a few strings that do not have TRADING Companies and these should be filtered out from the Result. What is the logic here?
It is difficult without proper info. If you are just looking for logic, then :
It sounds like a minus operation, set theory. But before using , since data have to be matched to the same type and numbers, then you need to do some operations to brin to the same platform, before you operate. A MINUS B.
Does it help?
Thanks a ton for your reply. I only saw your reply now... guess will try it at work tomorrow. I will try and implement and will keep you informed.