Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find table executing CTE #4941

Open
Trying-1831 opened this issue Feb 15, 2024 · 1 comment
Open

Unable to find table executing CTE #4941

Trying-1831 opened this issue Feb 15, 2024 · 1 comment

Comments

@Trying-1831
Copy link

Details

I have a SELECT statement that executes without error. When I embed the statement in a CTE, I get the message:
[13:12:37] Error while executing SQL query on database 'VX': no such table: MX.Chimp

Steps to reproduce

SQL:
select cID, VUID, mcKey,email, phone, cell
from MX.Chimp
where addr1 is not null

CTE:
with tmp(cID, VUID, mcKey, email, phone, cell) as (
select cID, VUID, mcKey,email, phone, cell
from MX.Chimp
where addr1 is not null
)
select * from tmp

Operating system

Hardware:
Device name Dumplin
Processor Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz 1.80 GHz
Installed RAM 16.0 GB (15.8 GB usable)
Device ID FF0EC767-6E97-4C09-B163-4AD58E358A54
Product ID 00325-81395-17902-AAOEM
System type 64-bit operating system, x64-based processor
Pen and touch Pen and touch support with 10 touch points

OS:
Edition Windows 10 Home
Version 22H2
Installed on ‎3/‎12/‎2021
OS build 19045.4046
Experience Windows Feature Experience Pack 1000.19053.1000.0

SQLiteStudio version

Version: 3.44.2
QT: 5.15.2

@Trying-1831
Copy link
Author

An additional test - I am executing in the active database with:
select a.abc from dbn.table - this works, but
with h as (select a.abc from dbn.table) select * from h; -- fails

with h as (select a.abc from table) select * from h; -- works

It looks as though there is a problem using fully qualified table names in a CTE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant