我在用ADO.NET Data Provider for SQLite: 1.0.82.0
聚合函数返回错误结果:
###Table structure###
CREATE TABLE ta85 (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, date INTEGER, _90 REAL, _100 REAL)
###Rows: ###
select * from ta85
id, date, _90, _100
"1","1355480577920","4,4","2"
"2","1355480877929","15","5,2"
"3","1355481177937","26,4","9,4"
------------------
现在,如果我想为每列选择最大值、最小值:
SELECT date,MIN(_90), MAX(_90),MIN(_100), MAX(_100) FROM ta85 WHERE date between 1355480296794 and 1355481366266
返回:
"1355481177937","15","4,4","2","9,4"
哪个 for column_100
是正确的,但是 for column_90
是错误的。
解决方案
感谢您的所有回答。你说的都是对的。
cmd.Parameters.AddWithValue(columname,"");
到
cmd.Parameters.AddWithValue(columname,0.0d);