You need to ask your question better....your example will give an answer but I 
have no idea what answer you are looking for.



Can you give a complete example?

CREATE TABLE TableA(z);
INSERT INTO "TableA" VALUES(2.0);
INSERT INTO "TableA" VALUES(4.0);
INSERT INTO "TableA" VALUES(8.0);
INSERT INTO "TableA" VALUES(12.0);
INSERT INTO "TableA" VALUES(16.0);
INSERT INTO "TableA" VALUES(20.0);
INSERT INTO "TableA" VALUES(20.0);
INSERT INTO "TableA" VALUES(24.0);
INSERT INTO "TableA" VALUES(24.0);
INSERT INTO "TableA" VALUES(24.0);



"What are the distinct Z values > 12.5"

sqlite> select distinct(z) from TableA where z>12.5;
16.0
20.0
24.0



Or

"What is the count of distinct Z values > 12.5"

sqlite> select sum(c) from(select count(z) as c from tablea where z>12.5 group 
by z);
6



Is there a different answer you want?





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: [email protected] [[email protected]] on 
behalf of YAN HONG YE [[email protected]]
Sent: Friday, June 29, 2012 12:23 AM
To: [email protected]
Subject: EXT :[sqlite] group by z HAVING count(z>12.5)=2

If I wanna to know how much z>12.5 result in the database,could I use this 
following cmd?
SELECT * from TableA WHERE z in (
   SELECT z FROM TableA GROUP BY z
   HAVING count(z>12.5)=2
);

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to