如何确定clickhouse中当前选定的数据库

vfhzx4xs  于 2021-07-15  发布在  ClickHouse
关注(0)|答案(1)|浏览(547)

如何找到最后一次使用 use <database> clickhouse中的命令?

w6lpcovy

w6lpcovy1#

需要使用currentdatabase函数:

SELECT currentDatabase()
/*
┌─currentDatabase()─┐
│ default           │
└───────────────────┘

* /

use system;

SELECT currentDatabase()
/*
┌─currentDatabase()─┐
│ system            │
└───────────────────┘

* /

与此功能相关的问题有:

6104:currentdatabase()+在群集ddl上创建表

github中的问题。。

相关问题