DROP TABLE IF EXISTS t2;
CREATE TABLE t2(c1 TINYINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MAX(c1) AS value FROM t2;
value
16
SELECT MAX(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
16
SELECT MAX(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-4
SELECT MAX(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MAX(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 SMALLINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MAX(c1) AS value FROM t2;
value
16
SELECT MAX(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
16
SELECT MAX(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-4
SELECT MAX(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MAX(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 MEDIUMINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MAX(c1) AS value FROM t2;
value
16
SELECT MAX(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
16
SELECT MAX(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-4
SELECT MAX(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MAX(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 INT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MAX(c1) AS value FROM t2;
value
16
SELECT MAX(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
16
SELECT MAX(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-4
SELECT MAX(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MAX(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 INTEGER NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MAX(c1) AS value FROM t2;
value
16
SELECT MAX(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
16
SELECT MAX(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-4
SELECT MAX(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MAX(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 BIGINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MAX(c1) AS value FROM t2;
value
16
SELECT MAX(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
16
SELECT MAX(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-4
SELECT MAX(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MAX(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 TINYINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MIN(c1) AS value FROM t2;
value
-9
SELECT MIN(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
1
SELECT MIN(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-9
SELECT MIN(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MIN(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 SMALLINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MIN(c1) AS value FROM t2;
value
-9
SELECT MIN(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
1
SELECT MIN(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-9
SELECT MIN(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MIN(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 MEDIUMINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MIN(c1) AS value FROM t2;
value
-9
SELECT MIN(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
1
SELECT MIN(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-9
SELECT MIN(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MIN(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 INT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MIN(c1) AS value FROM t2;
value
-9
SELECT MIN(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
1
SELECT MIN(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-9
SELECT MIN(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MIN(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 INTEGER NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MIN(c1) AS value FROM t2;
value
-9
SELECT MIN(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
1
SELECT MIN(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-9
SELECT MIN(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MIN(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 BIGINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT MIN(c1) AS value FROM t2;
value
-9
SELECT MIN(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
1
SELECT MIN(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-9
SELECT MIN(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT MIN(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 TINYINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT AVG(c1) AS value FROM t2;
value
0.8000
SELECT AVG(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
8.5000
SELECT AVG(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-6.5000
SELECT AVG(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0.0000
SELECT AVG(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 SMALLINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT AVG(c1) AS value FROM t2;
value
0.8000
SELECT AVG(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
8.5000
SELECT AVG(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-6.5000
SELECT AVG(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0.0000
SELECT AVG(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 MEDIUMINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT AVG(c1) AS value FROM t2;
value
0.8000
SELECT AVG(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
8.5000
SELECT AVG(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-6.5000
SELECT AVG(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0.0000
SELECT AVG(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 INT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT AVG(c1) AS value FROM t2;
value
0.8000
SELECT AVG(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
8.5000
SELECT AVG(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-6.5000
SELECT AVG(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0.0000
SELECT AVG(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 INTEGER NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT AVG(c1) AS value FROM t2;
value
0.8000
SELECT AVG(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
8.5000
SELECT AVG(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-6.5000
SELECT AVG(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0.0000
SELECT AVG(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 BIGINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT AVG(c1) AS value FROM t2;
value
0.8000
SELECT AVG(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
8.5000
SELECT AVG(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-6.5000
SELECT AVG(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0.0000
SELECT AVG(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 TINYINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT SUM(c1) AS value FROM t2;
value
4
SELECT SUM(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
17
SELECT SUM(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-13
SELECT SUM(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT SUM(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 SMALLINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT SUM(c1) AS value FROM t2;
value
4
SELECT SUM(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
17
SELECT SUM(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-13
SELECT SUM(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT SUM(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 MEDIUMINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT SUM(c1) AS value FROM t2;
value
4
SELECT SUM(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
17
SELECT SUM(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-13
SELECT SUM(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT SUM(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 INT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT SUM(c1) AS value FROM t2;
value
4
SELECT SUM(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
17
SELECT SUM(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-13
SELECT SUM(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT SUM(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 INTEGER NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT SUM(c1) AS value FROM t2;
value
4
SELECT SUM(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
17
SELECT SUM(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-13
SELECT SUM(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT SUM(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 BIGINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT SUM(c1) AS value FROM t2;
value
4
SELECT SUM(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
17
SELECT SUM(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
-13
SELECT SUM(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
0
SELECT SUM(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
NULL
DROP TABLE t2;
CREATE TABLE t2(c1 TINYINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT COUNT(c1) AS value FROM t2;
value
5
SELECT COUNT(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
2
SELECT COUNT(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
2
SELECT COUNT(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
1
SELECT COUNT(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
0
DROP TABLE t2;
CREATE TABLE t2(c1 SMALLINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT COUNT(c1) AS value FROM t2;
value
5
SELECT COUNT(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
2
SELECT COUNT(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
2
SELECT COUNT(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
1
SELECT COUNT(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
0
DROP TABLE t2;
CREATE TABLE t2(c1 MEDIUMINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT COUNT(c1) AS value FROM t2;
value
5
SELECT COUNT(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
2
SELECT COUNT(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
2
SELECT COUNT(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
1
SELECT COUNT(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
0
DROP TABLE t2;
CREATE TABLE t2(c1 INT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT COUNT(c1) AS value FROM t2;
value
5
SELECT COUNT(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
2
SELECT COUNT(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
2
SELECT COUNT(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
1
SELECT COUNT(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
0
DROP TABLE t2;
CREATE TABLE t2(c1 INTEGER NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT COUNT(c1) AS value FROM t2;
value
5
SELECT COUNT(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
2
SELECT COUNT(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
2
SELECT COUNT(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
1
SELECT COUNT(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
0
DROP TABLE t2;
CREATE TABLE t2(c1 BIGINT NOT NULL);
INSERT INTO t2 (c1) VALUES(0);
INSERT INTO t2 (c1) VALUES(1);
INSERT INTO t2 (c1) VALUES(16);
INSERT INTO t2 (c1) VALUES(-4);
INSERT INTO t2 (c1) VALUES(-9);
SELECT COUNT(c1) AS value FROM t2;
value
5
SELECT COUNT(c1) AS postive_value FROM t2 WHERE c1 > 0;
postive_value
2
SELECT COUNT(c1) AS negative_value FROM t2 WHERE c1 < 0;
negative_value
2
SELECT COUNT(c1) AS zero_value FROM t2 WHERE c1 = 0;
zero_value
1
SELECT COUNT(c1) AS no_results FROM t2 WHERE c1 = 2;
no_results
0
DROP TABLE t2;
