Last login: Tue Jun 4 22:23:34 on ttys001 curl https://clickhouse.com/ | sh The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050. GithubIireAchao:blog achao$ curl https://clickhouse.com/ | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2822 0 2822 0 0 3400 0 --:--:-- --:--:-- --:--:-- 3400
Will download https://builds.clickhouse.com/master/macos-aarch64/clickhouse into clickhouse
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 68.1M 100 68.1M 0 0 10.8M 0 0:00:06 0:00:06 --:--:-- 14.0M
Successfully downloaded the ClickHouse binary, you can run it as: ./clickhouse GithubIireAchao:blog achao$ ./clickhouse ... ClickHouse local version 24.6.1.3290 (official build).
INSERTINTO my_first_table (user_id, message, timestamp, metric) VALUES (101, 'Hello, ClickHouse!', now(), -1.0 ), (102, 'Insert a lot of rows per batch', yesterday(), 1.41421 ), (102, 'Sort your data based on your commonly-used queries', today(), 2.718 ), (101, 'Granules are the smallest chunks of data read', now() +5, 3.14159 )
查询
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
githubiireachao :) SELECT* FROM my_first_table ORDERBYtimestamp
SELECT* FROM my_first_table ORDERBYtimestampASC
Query id: 2997657d-89e0-4280-8333-428c67106986
┌─user_id─┬─message────────────────────────────────────────────┬───────────timestamp─┬──metric─┐ 1. │ 102 │ Insert a lot ofrowsper batch │ 2024-06-0900:00:00 │ 1.41421 │ 2. │ 102 │ Sort your data based on your commonly-used queries │ 2024-06-1000:00:00 │ 2.718 │ 3. │ 101 │ Hello, ClickHouse! │ 2024-06-1016:43:25 │ -1 │ 4. │ 101 │ Granules are the smallest chunks of data read │ 2024-06-1016:43:31 │ 3.14159 │ └─────────┴────────────────────────────────────────────────────┴─────────────────────┴─────────┘