I have asked how to use the 'IN' here.
So far, this SQL Server query:
select *
from table
where column1 in
(
select column2
from table
)
can be translated as:
table.Select(
string.Format("column1 in ({0})",
string.Join(",", table Rows.OfType<DataRow>()
.Select(r=>r["column2"].ToString())
.Distinct())));
My question is how to translate this SQL query:
select column3
from table
where column1 in
(
select column2
from table
)
So that I can use what's inside on column3 on another 'IN'.
(e.g.)
select columnA
from table2
where columnB in
(
select column3
from table1
where column1 in
(
select column2
from table1
)
)