0

Hi geeks,

I really need your help. I want to query in a table in MS SQL using a data in another table.
This might give you an idea on what I am talking about. This is the query I've constructed : "SELECT TABLE1.FIELD1,TABLE1.FIELD2 FROM TABLE1, TABLE2
WHERE TABLE1.FIELD3 = (SELECT TABLE2.FIELD3 FROM TABLE2
WHERE TABLE2.FIELD4 BETWEEN 'A1' AND 'A50')".

Please guys reply...I experimented a lot but still unsuccessful.

Thanks in advance...

WHchaz1027

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by WHchaz1027
0
SELECT field1, field2
FROM table1
WHERE field3 IN (
  SELECT field3 
  FROM table2
  WHERE field4 BETWEEN 'A1' AND 'A50'
)
0

Thanks Man...

Your code is right. At last, Now I can proceed to the next level. Thanks again man..I owe you this.

WHchaz1027

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.