在查询的SELECT部分中没有问题,但是当我在where子句中使用相同的语句时,我得到了一个"ORA-01858: a non-numeric character the found WHERE a numericwas a numeric is expected a numeric“,它指的是第一次在WHERE子句的TO_DATE中使用concat。那么,在where子句中使用concat和TO_DATE
我在postgres中有一个“目录”模式,其中包含存储公司名称及其模式的下表: companies(id int, name string, schema string) 每家公司都有一个包含相同表的模式我想遍历这个表,并计算每个公司的所有用户,如下所示: select (count(u.id) from concat(c.schema, '.users') u ) usersCountfrom catalog.companies c 显然,这种方法不起作用,我看到一些帖子展示了如何使用预准备