This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ clickhouse-client | |
ClickHouse client version 0.0.53720. | |
Connecting to localhost:9000. | |
Connected to ClickHouse server version 1.1.53981. | |
:) CREATE TABLE test.funnel (userID UInt64, eventType Enum8('A' = 1, 'B' = 2), EventTime Date, Age UInt8) ENGINE = Memory | |
CREATE TABLE test.funnel | |
( | |
userID UInt64, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:) CREATE TABLE test.nested (EventDate Date, UserID UInt64, Attrs Nested(Key String, Value String)) ENGINE = MergeTree(EventDate, UserID, 8192) | |
CREATE TABLE test.nested | |
( | |
EventDate Date, | |
UserID UInt64, | |
Attrs Nested( | |
Key String, | |
Value String) | |
) ENGINE = MergeTree(EventDate, UserID, 8192) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:) SELECT toMonday(EventDate) AS k, count(), uniq(UserID) FROM hits_layer WHERE CounterID = 29761725 AND EventDate >= '2016-05-01' GROUP BY k ORDER BY k | |
SELECT | |
toMonday(EventDate) AS k, | |
count(), | |
uniq(UserID) | |
FROM hits_layer | |
WHERE (CounterID = 29761725) AND (EventDate >= '2016-05-01') | |
GROUP BY k | |
ORDER BY k ASC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:) SELECT toDateTime(intDiv(toUInt32(EventTime), 5) * 5) AS k, count(), uniq(UserID) FROM hits_layer WHERE CounterID = 29761725 AND EventDate = today() AND EventTime >= now() - 600 GROUP BY k ORDER BY k | |
SELECT | |
toDateTime(intDiv(toUInt32(EventTime), 5) * 5) AS k, | |
count(), | |
uniq(UserID) | |
FROM hits_layer | |
WHERE (CounterID = 29761725) AND (EventDate = today()) AND (EventTime >= (now() - 600)) | |
GROUP BY k | |
ORDER BY k ASC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ clickhouse-client | |
ClickHouse client version 0.0.53720. | |
Connecting to localhost:9000. | |
Connected to ClickHouse server version 1.1.53981. | |
:) create table hoba (naber Date) ENGINE = MergeTree(naber, (1, naber), 8192) | |
CREATE TABLE hoba | |
( | |
naber Date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
milovidov@milovidov-xenial:~$ clickhouse-client | |
ClickHouse client version 1.1.53996. | |
Connecting to localhost:9000. | |
Connected to ClickHouse server version 1.1.53996. | |
:) CREATE TABLE IF NOT EXISTS `employee` ( | |
:-] `empid` Int32, | |
:-] `deptid` Int32, | |
:-] `salary` Int64 | |
:-] ) ENGINE = Memory; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:) SELECT name, formatReadableSize(sum(bytes)) FROM system.columns WHERE table = 'graphite_impl' AND database = 'default' GROUP BY name ORDER BY sum(bytes) DESC | |
SELECT | |
name, | |
formatReadableSize(sum(bytes)) | |
FROM system.columns | |
WHERE (table = 'graphite_impl') AND (database = 'default') | |
GROUP BY name | |
ORDER BY sum(bytes) DESC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:) SELECT uniq(UserID) FROM hits_all WHERE EventDate = today() | |
SELECT uniq(UserID) | |
FROM hits_all | |
WHERE EventDate = today() | |
┌─uniq(UserID)─┐ | |
│ 321993104 │ | |
└──────────────┘ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 113 | |
Server version: 5.5.50-0ubuntu0.14.04.1 (Ubuntu) | |
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. | |
Oracle is a registered trademark of Oracle Corporation and/or its | |
affiliates. Other names may be trademarks of their respective | |
owners. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:) SELECT C_REGION, C_NATION, count(*) FROM lineorder_x3 GLOBAL ANY INNER JOIN ( SELECT C_REGION, C_NATION, C_CUSTKEY AS LO_CUSTKEY FROM customer_x3 ) USING (LO_CUSTKEY) WHERE (toYear(LO_ORDERDATE) > 1993) AND (LO_DISCOUNT >= 1) AND (LO_QUANTITY < 25) GROUP BY C_REGION, C_NATION; | |
SELECT | |
C_REGION, | |
C_NATION, | |
count(*) | |
FROM lineorder_x3 | |
GLOBAL ANY INNER JOIN | |
( | |
SELECT |
OlderNewer