J
john pp nn
Guest
Hi there,
I have a dataTable like this...
Col1, Col2
HAD 123
HAD 123
LEM 124
LEM 124
PLA 125
PLA 125
HAD 125
I want to query the datable to select every col1 that has more than 1 distinct col 2. ie HAD has 123 and 125
If it were a real table the following sql would work..
SELECT distinct(col1) as col1, count(*) as col2 FROM myTable
GROUP BY col1 having col2 > 0
Im just not sure how to apply this to a dataTable. I cant see how I can use the dataTable.Select("") method with a complex SQL statement.
Any ideas,
J
jppnn
Continue reading...
I have a dataTable like this...
Col1, Col2
HAD 123
HAD 123
LEM 124
LEM 124
PLA 125
PLA 125
HAD 125
I want to query the datable to select every col1 that has more than 1 distinct col 2. ie HAD has 123 and 125
If it were a real table the following sql would work..
SELECT distinct(col1) as col1, count(*) as col2 FROM myTable
GROUP BY col1 having col2 > 0
Im just not sure how to apply this to a dataTable. I cant see how I can use the dataTable.Select("") method with a complex SQL statement.
Any ideas,
J
jppnn
Continue reading...