查询注意 避免使用 SELECT * 查询 WITH WITH 子句只能返回一行数据 定义变量 1 WITH 10 AS var_name SELECT ... 调用函数 1 WITH SUM(column_name) AS with_name SELECT ... 定义子查询 1 2 3 4 WITH ( SELECT ... ) AS with_name SELECt ... WITH 子句可在子
Live View 视图简介 类似时间监听器 需设置 allow_experimental_live_view 为 1,检查 1 SELECT name, value FROM system.settings WHERE name LIKE '%live_view%'; 创建 Live View 视图 创建 1 CREATE LIVE VIEW lv_name AS SELECT count(*) FROM table_name; 监听 1 WATCH lv_name