Coggle requires JavaScript to display documents.
SELECT col1 FROM t1; SELECT col1+col2 FROM t1; SELECT col1, col1+col2, concat(col1, col2) FROM t1;
SELECT DISTINCT col1, col2 FROM t1;
SELECT SUM(col1) from t1 GROUP BY col2;
SELECT sum(col1) FROM t1 group by substr(col0, 0, 6);
SELECT col1, col2 FROM t1 ORDER BY col3;
SELECT col1, col2 FROM t1 ORDER BY col1+col2;
SELECT col1, col2 FROM t1 where concat(col1,col2) = 'hello world';
SELECT col1, col2, col3 FROM t1 WHERE col1="hello" and concat(col1, col2) == "hello world";
SELECT col1 FROM t1 LIMIT 100;
SELECT col1 FROM t1 LIMIT 100 OFFSET 20;
SELECT t1.col1, t1.col2, t2.c1, t2.c2 FROM t1 LAST JOIN t2 ORDER BY t2.c1 ON t1.col1 = t2.c1;
SELECT t1.col1, t1.col2, t2.c1, t2.c2 FROM t1 LAST JOIN t2 ORDER BY t2.c1 ON t1.col1+t1.col2 = t2.c1+t2.c2
SELECT c1, c2, c3 from (SELECT col1 as c1, col2 as c2, col3 as c3 from t2);
SELECT c1, c2, c3 from (SELECT col1+col2 as c1, concat(col1, col2) as c2, hour(col3) as c3 from t1;
CREATE TABLE t1 AS SELECT col1, col2, col3 FROM t2;
CREATE TABLE t1 [IF NOT EXIST] ( col1 INT NOT NULL, col2 BIGINT NOT NULL, col3 STRING NOT NULL, INDEX(key=col1, ts=col2); );
CREATE PROCEDURE sp1 AS BEGIN SELECT col1, col2, col3 from t1; END
CREATE PROCEDURE sp1 AS BEGIN INSERT INTO t1 VALUES(1, 2.0, 'hello'); INSERT INTO t1 VALUES(11, 12.0, 'world'); SELECT col1, col2, col3 from t1;
INSERT INTO t1 SELECT col1, col2, col1+col2 as col1_add_col2 from t2;
INSERT INTO t1 VALUES(1, 2.0, 'hello'); INSERT INTO t1 (col1, col2) VALUES(1, 2.0);