I think I have an idea about how to do this, just looking for some input. I think I have to do 2 queries. The first query gets the distinct values in a table which returns a list of integer values. I would then want to use these numbers in the 2nd query.
Any number of values could be returned from query1. My question is how do I use that info in query 2? I think I have to use the IN statement. Do I have to use commandbuilder because I don't know how many results will be returned?
query1:
2 Code:
SELECT DISTINCT myCol1 FROM someTable
query2:
2 Code:
SELECT * FROM otherTable WHERE myCol IN (int1, int2, int3, int4.....)
How do I construct the IN part with the results returned from query1 ?


Reply With Quote
