Hiho, Summary: i'm getting an incorrect/unexpected MIN()/MAX() results and have no clue why. After running these results by a colleague, we're both confused, and thus this post. Here's my data (JMeter output) and results:
SQLite version 3.7.16 2013-01-03 19:34:46 (built from sources updated an hour or so ago) ... sqlite> .header on sqlite> select * from res where label='access service'; ts,elapsed,label,rc,msg,thread,dataType,success,bytes,latency 1360586493370,27,access service,200,OK,Thread Group 1-1,text,true,4379,27 1360586494947,20,access service,200,OK,Thread Group 1-2,text,true,4378,20 1360586496927,6,access service,200,OK,Thread Group 1-3,text,true,4378,6 1360586499102,5,access service,200,OK,Thread Group 1-4,text,true,4378,5 1360586501135,6,access service,200,OK,Thread Group 1-5,text,true,4378,6 1360586503112,5,access service,200,OK,Thread Group 1-6,text,true,4378,5 1360586505116,7,access service,200,OK,Thread Group 1-7,text,true,4378,7 1360586507133,6,access service,200,OK,Thread Group 1-8,text,true,4378,6 1360586509333,6,access service,200,OK,Thread Group 1-9,text,true,4377,6 1360586511238,6,access service,200,OK,Thread Group 1-10,text,true,4378,6 1360586513321,6,access service,200,OK,Thread Group 1-11,text,true,4378,6 1360586515244,7,access service,200,OK,Thread Group 1-12,text,true,4378,7 1360586517295,6,access service,200,OK,Thread Group 1-13,text,true,4378,6 1360586519255,6,access service,200,OK,Thread Group 1-14,text,true,4378,6 1360586521261,5,access service,200,OK,Thread Group 1-15,text,true,4378,5 1360586523329,6,access service,200,OK,Thread Group 1-16,text,true,4378,6 1360586525316,6,access service,200,OK,Thread Group 1-17,text,true,4377,6 1360586527325,6,access service,200,OK,Thread Group 1-18,text,true,4378,6 1360586529301,6,access service,200,OK,Thread Group 1-19,text,true,4378,6 1360586531308,6,access service,200,OK,Thread Group 1-20,text,true,4378,6 Notice that the min/max "elapsed" values are 5 and 27, respectively. Now my results (which i cannot explain)... sqlite> SELECT label, count(*), MIN(elapsed), AVG(elapsed), MAX(elapsed) FROM res where label='access service'; label,count(*),MIN(elapsed),AVG(elapsed),MAX(elapsed) access service,20,20,7.7,7 sqlite> SELECT label, count(*), MIN(elapsed), AVG(elapsed), MAX(elapsed) FROM res where label='access service' GROUP BY label; label,count(*),MIN(elapsed),AVG(elapsed),MAX(elapsed) access service,20,20,7.7,7 sqlite> select count(*) from res where label='access service'; count(*) 20 sqlite> select MIN(elapsed) from res where label='access service'; MIN(elapsed) 20 sqlite> select AVG(elapsed) from res where label='access service'; AVG(elapsed) 7.7 sqlite> select MAX(elapsed) from res where label='access service'; MAX(elapsed) 7 sqlite> select label, MAX(elapsed) from res group by label; label,MAX(elapsed) access service,7 autocomplete: choose LeadSource,70 autocomplete: choose LeadType,79 ... sqlite> select MIN(elapsed), MAX(elapsed) from res where label='access service'; MIN(elapsed) MAX(elapsed) 20 7 i'm very confused. Surely i'm doing something wrong here (as i refuse to believe that this is an sqlite3 bug)? :-? PS: i'm not an sql guru. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

