P
pplppp
I have a table with fields the following fields
ID INTEGER (Primary key)
FLAG BOOL
TIMESPAN DATETIME
IMPORTANCE INTEGER
say I want to find the an ID with flag set to true, highest importance
and shortest timespan. so one way to write the SQL is this:
SELECT ID
FROM MyTable
WHERE TIMESPAN =
(SELECT MIN(TIMESPAN )
FROM MyTable
WHERE FLAG=TRUE AND IMPORTANCE =
(SELECT MAX(IMPORTANCE )
FROM MyTable
WHERE FLAG=TRUE));
so. my problem is. the data is in a dataTable and the DataTable.Select
method doesn't take SQL statements. So can something teach me how to
find what I need from the DataTable?
thxs in advance
..Net newB
ID INTEGER (Primary key)
FLAG BOOL
TIMESPAN DATETIME
IMPORTANCE INTEGER
say I want to find the an ID with flag set to true, highest importance
and shortest timespan. so one way to write the SQL is this:
SELECT ID
FROM MyTable
WHERE TIMESPAN =
(SELECT MIN(TIMESPAN )
FROM MyTable
WHERE FLAG=TRUE AND IMPORTANCE =
(SELECT MAX(IMPORTANCE )
FROM MyTable
WHERE FLAG=TRUE));
so. my problem is. the data is in a dataTable and the DataTable.Select
method doesn't take SQL statements. So can something teach me how to
find what I need from the DataTable?
thxs in advance
..Net newB