-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Describe the bug
In our system, the generated SQL will automatically use the form like db.table , but in CTE it do NOT works.
On the other hand, create table/view support grammar like db.table or db.view.
We hope that CTE can also support this feature
The case is shown as below
MySQL [(none)]> with tmp as (select dt, app, chan, count(distinct uids) as uv FROM db.mytale WHERE dt = 20200913 group by dt, app, chan)
-> select dt,app,
-> sum(uv) as uv,
-> sum(distinct case when chan= 1 then uv else 0 end) as new_uv
-> from tmp
-> group by dt, app;
ERROR 1046 (3D000): errCode = 2, detailMessage = No database selected
MySQL [(none)]>
Also, SQL statements like with db.tmp (....) cannot be run
To Reproduce
Expected behavior
support statement like
with database.tmp (xxx)
select f1 from database.tmp ...
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels