DROP TABLE IF EXISTS t4,t5;
CREATE TABLE t4(c1 DECIMAL(1,0) NOT NULL);
INSERT INTO t4 (c1) VALUES(0);
INSERT INTO t4 (c1) VALUES(1.0);
INSERT INTO t4 (c1) VALUES(-9.0);
SELECT * FROM t4;
c1
0
1
-9
SELECT COUNT(c1) AS total_rows FROM t4;
total_rows
3
SELECT COUNT(c1) AS positive_rows FROM t4 WHERE c1 > 0.0;
positive_rows
1
SELECT COUNT(c1) AS negative_rows FROM t4 WHERE c1 < 0.0;
negative_rows
1
SELECT COUNT(c1) AS zero_rows FROM t4 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t4;
CREATE TABLE t5(c1 DECIMAL(5,4) NOT NULL);
INSERT INTO t5 (c1) VALUES(0);
INSERT INTO t5 (c1) VALUES(1.0);
INSERT INTO t5 (c1) VALUES(1.2345);
INSERT INTO t5 (c1) VALUES(-9.0);
INSERT INTO t5 (c1) VALUES(-9.12345);
Warnings:
Note	1265	Data truncated for column 'c1' at row 1
SELECT * FROM t5;
c1
0.0000
1.0000
1.2345
-9.0000
-9.1235
SELECT COUNT(c1) AS positive_rows FROM t5 WHERE c1 > 0.0;
positive_rows
2
SELECT COUNT(c1) AS negative_rows FROM t5 WHERE c1 < 0.0;
negative_rows
2
SELECT COUNT(c1) AS zero_rows FROM t5 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t5;
CREATE TABLE t4(c1 DEC(1,0) NOT NULL);
INSERT INTO t4 (c1) VALUES(0);
INSERT INTO t4 (c1) VALUES(1.0);
INSERT INTO t4 (c1) VALUES(-9.0);
SELECT * FROM t4;
c1
0
1
-9
SELECT COUNT(c1) AS total_rows FROM t4;
total_rows
3
SELECT COUNT(c1) AS positive_rows FROM t4 WHERE c1 > 0.0;
positive_rows
1
SELECT COUNT(c1) AS negative_rows FROM t4 WHERE c1 < 0.0;
negative_rows
1
SELECT COUNT(c1) AS zero_rows FROM t4 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t4;
CREATE TABLE t5(c1 DEC(5,4) NOT NULL);
INSERT INTO t5 (c1) VALUES(0);
INSERT INTO t5 (c1) VALUES(1.0);
INSERT INTO t5 (c1) VALUES(1.2345);
INSERT INTO t5 (c1) VALUES(-9.0);
INSERT INTO t5 (c1) VALUES(-9.12345);
Warnings:
Note	1265	Data truncated for column 'c1' at row 1
SELECT * FROM t5;
c1
0.0000
1.0000
1.2345
-9.0000
-9.1235
SELECT COUNT(c1) AS positive_rows FROM t5 WHERE c1 > 0.0;
positive_rows
2
SELECT COUNT(c1) AS negative_rows FROM t5 WHERE c1 < 0.0;
negative_rows
2
SELECT COUNT(c1) AS zero_rows FROM t5 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t5;
CREATE TABLE t4(c1 FIXED(1,0) NOT NULL);
INSERT INTO t4 (c1) VALUES(0);
INSERT INTO t4 (c1) VALUES(1.0);
INSERT INTO t4 (c1) VALUES(-9.0);
SELECT * FROM t4;
c1
0
1
-9
SELECT COUNT(c1) AS total_rows FROM t4;
total_rows
3
SELECT COUNT(c1) AS positive_rows FROM t4 WHERE c1 > 0.0;
positive_rows
1
SELECT COUNT(c1) AS negative_rows FROM t4 WHERE c1 < 0.0;
negative_rows
1
SELECT COUNT(c1) AS zero_rows FROM t4 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t4;
CREATE TABLE t5(c1 FIXED(5,4) NOT NULL);
INSERT INTO t5 (c1) VALUES(0);
INSERT INTO t5 (c1) VALUES(1.0);
INSERT INTO t5 (c1) VALUES(1.2345);
INSERT INTO t5 (c1) VALUES(-9.0);
INSERT INTO t5 (c1) VALUES(-9.12345);
Warnings:
Note	1265	Data truncated for column 'c1' at row 1
SELECT * FROM t5;
c1
0.0000
1.0000
1.2345
-9.0000
-9.1235
SELECT COUNT(c1) AS positive_rows FROM t5 WHERE c1 > 0.0;
positive_rows
2
SELECT COUNT(c1) AS negative_rows FROM t5 WHERE c1 < 0.0;
negative_rows
2
SELECT COUNT(c1) AS zero_rows FROM t5 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t5;
CREATE TABLE t4(c1 NUMERIC(1,0) NOT NULL);
INSERT INTO t4 (c1) VALUES(0);
INSERT INTO t4 (c1) VALUES(1.0);
INSERT INTO t4 (c1) VALUES(-9.0);
SELECT * FROM t4;
c1
0
1
-9
SELECT COUNT(c1) AS total_rows FROM t4;
total_rows
3
SELECT COUNT(c1) AS positive_rows FROM t4 WHERE c1 > 0.0;
positive_rows
1
SELECT COUNT(c1) AS negative_rows FROM t4 WHERE c1 < 0.0;
negative_rows
1
SELECT COUNT(c1) AS zero_rows FROM t4 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t4;
CREATE TABLE t5(c1 NUMERIC(5,4) NOT NULL);
INSERT INTO t5 (c1) VALUES(0);
INSERT INTO t5 (c1) VALUES(1.0);
INSERT INTO t5 (c1) VALUES(1.2345);
INSERT INTO t5 (c1) VALUES(-9.0);
INSERT INTO t5 (c1) VALUES(-9.12345);
Warnings:
Note	1265	Data truncated for column 'c1' at row 1
SELECT * FROM t5;
c1
0.0000
1.0000
1.2345
-9.0000
-9.1235
SELECT COUNT(c1) AS positive_rows FROM t5 WHERE c1 > 0.0;
positive_rows
2
SELECT COUNT(c1) AS negative_rows FROM t5 WHERE c1 < 0.0;
negative_rows
2
SELECT COUNT(c1) AS zero_rows FROM t5 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t5;
CREATE TABLE t4(c1 DOUBLE(1,0) NOT NULL);
INSERT INTO t4 (c1) VALUES(0);
INSERT INTO t4 (c1) VALUES(1.0);
INSERT INTO t4 (c1) VALUES(-9.0);
SELECT * FROM t4;
c1
0
1
-9
SELECT COUNT(c1) AS total_rows FROM t4;
total_rows
3
SELECT COUNT(c1) AS positive_rows FROM t4 WHERE c1 > 0.0;
positive_rows
1
SELECT COUNT(c1) AS negative_rows FROM t4 WHERE c1 < 0.0;
negative_rows
1
SELECT COUNT(c1) AS zero_rows FROM t4 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t4;
CREATE TABLE t5(c1 DOUBLE(5,4) NOT NULL);
INSERT INTO t5 (c1) VALUES(0);
INSERT INTO t5 (c1) VALUES(1.0);
INSERT INTO t5 (c1) VALUES(1.2345);
INSERT INTO t5 (c1) VALUES(-9.0);
INSERT INTO t5 (c1) VALUES(-9.12345);
SELECT * FROM t5;
c1
0.0000
1.0000
1.2345
-9.0000
-9.1234
SELECT COUNT(c1) AS positive_rows FROM t5 WHERE c1 > 0.0;
positive_rows
2
SELECT COUNT(c1) AS negative_rows FROM t5 WHERE c1 < 0.0;
negative_rows
2
SELECT COUNT(c1) AS zero_rows FROM t5 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t5;
CREATE TABLE t4(c1 REAL(1,0) NOT NULL);
INSERT INTO t4 (c1) VALUES(0);
INSERT INTO t4 (c1) VALUES(1.0);
INSERT INTO t4 (c1) VALUES(-9.0);
SELECT * FROM t4;
c1
0
1
-9
SELECT COUNT(c1) AS total_rows FROM t4;
total_rows
3
SELECT COUNT(c1) AS positive_rows FROM t4 WHERE c1 > 0.0;
positive_rows
1
SELECT COUNT(c1) AS negative_rows FROM t4 WHERE c1 < 0.0;
negative_rows
1
SELECT COUNT(c1) AS zero_rows FROM t4 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t4;
CREATE TABLE t5(c1 REAL(5,4) NOT NULL);
INSERT INTO t5 (c1) VALUES(0);
INSERT INTO t5 (c1) VALUES(1.0);
INSERT INTO t5 (c1) VALUES(1.2345);
INSERT INTO t5 (c1) VALUES(-9.0);
INSERT INTO t5 (c1) VALUES(-9.12345);
SELECT * FROM t5;
c1
0.0000
1.0000
1.2345
-9.0000
-9.1234
SELECT COUNT(c1) AS positive_rows FROM t5 WHERE c1 > 0.0;
positive_rows
2
SELECT COUNT(c1) AS negative_rows FROM t5 WHERE c1 < 0.0;
negative_rows
2
SELECT COUNT(c1) AS zero_rows FROM t5 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t5;
CREATE TABLE t4(c1 DOUBLE PRECISION(1,0) NOT NULL);
INSERT INTO t4 (c1) VALUES(0);
INSERT INTO t4 (c1) VALUES(1.0);
INSERT INTO t4 (c1) VALUES(-9.0);
SELECT * FROM t4;
c1
0
1
-9
SELECT COUNT(c1) AS total_rows FROM t4;
total_rows
3
SELECT COUNT(c1) AS positive_rows FROM t4 WHERE c1 > 0.0;
positive_rows
1
SELECT COUNT(c1) AS negative_rows FROM t4 WHERE c1 < 0.0;
negative_rows
1
SELECT COUNT(c1) AS zero_rows FROM t4 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t4;
CREATE TABLE t5(c1 DOUBLE PRECISION(5,4) NOT NULL);
INSERT INTO t5 (c1) VALUES(0);
INSERT INTO t5 (c1) VALUES(1.0);
INSERT INTO t5 (c1) VALUES(1.2345);
INSERT INTO t5 (c1) VALUES(-9.0);
INSERT INTO t5 (c1) VALUES(-9.12345);
SELECT * FROM t5;
c1
0.0000
1.0000
1.2345
-9.0000
-9.1234
SELECT COUNT(c1) AS positive_rows FROM t5 WHERE c1 > 0.0;
positive_rows
2
SELECT COUNT(c1) AS negative_rows FROM t5 WHERE c1 < 0.0;
negative_rows
2
SELECT COUNT(c1) AS zero_rows FROM t5 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t5;
CREATE TABLE t4(c1 FLOAT(1,0) NOT NULL);
INSERT INTO t4 (c1) VALUES(0);
INSERT INTO t4 (c1) VALUES(1.0);
INSERT INTO t4 (c1) VALUES(-9.0);
SELECT * FROM t4;
c1
0
1
-9
SELECT COUNT(c1) AS total_rows FROM t4;
total_rows
3
SELECT COUNT(c1) AS positive_rows FROM t4 WHERE c1 > 0.0;
positive_rows
1
SELECT COUNT(c1) AS negative_rows FROM t4 WHERE c1 < 0.0;
negative_rows
1
SELECT COUNT(c1) AS zero_rows FROM t4 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t4;
CREATE TABLE t5(c1 FLOAT(5,4) NOT NULL);
INSERT INTO t5 (c1) VALUES(0);
INSERT INTO t5 (c1) VALUES(1.0);
INSERT INTO t5 (c1) VALUES(1.2345);
INSERT INTO t5 (c1) VALUES(-9.0);
INSERT INTO t5 (c1) VALUES(-9.12345);
SELECT * FROM t5;
c1
0.0000
1.0000
1.2345
-9.0000
-9.1234
SELECT COUNT(c1) AS positive_rows FROM t5 WHERE c1 > 0.0;
positive_rows
2
SELECT COUNT(c1) AS negative_rows FROM t5 WHERE c1 < 0.0;
negative_rows
2
SELECT COUNT(c1) AS zero_rows FROM t5 WHERE c1 = 0.0;
zero_rows
1
DROP TABLE t5;
