I am trying to narrow the rows that are in my DataView based on a relationship with another table, and the RowFilter I use looks like this:
dv = new DataView(myDS.myTable, "id IN (SELECT DISTINCT parentID FROM myOtherTable)", "name asc", DataViewRowState.CurrentRows);
The table myTable and myOther are associated with myTable.ID and myOtherTable.parentID, so the idea is that the DataView should contain only rows from "myTable" that have corresponding child rows in "myOtherTable".
Sorry, I get this error:
Syntax error: Missing operand after DISTINCT statement.
SQL is okay as far as I know, so I wonder if there are some restrictions on using the DISTINCT keyword as part of RowFilter SQL? Does anyone have an idea?
source share