How should I fix this code with RuntimeError: Catalog Error: Schema with name a does not exist!? (SQL)
How should I fix this code with RuntimeError: Catalog Error: Schema with name a does not exist!? (SQL)
我有 2 个表,如下所示:
我想查找按城市排序的员工全名以及毕业和薪水。这是我的代码:
import duckdb
con = duckdb.connect(database=':memory:')
con.execute("""
select
a.CONCAT(FirstName , ' ' ,LastName) as FullName,
b.GradID,
b.Salary
from
T_Emp a
full join
T_Grad b
on
a.GradID = b.GradID
order by City;
""").df()
我得到的错误:
ERROR:root:An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 0))
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-30-85b9d80141b2> in <module>()
11 a.GradID = b.GradID
12 order by City;
---> 13 """).df()
RuntimeError: Catalog Error: Schema with name a does not exist!
LINE 3: a.CONCAT(FirstName , ' ' ,LastN...
您对连接字符串的查询有误,请按以下方法解决:
CONCAT(a.FirstName , ' ' ,a.LastName) as FullName
我有 2 个表,如下所示:
我想查找按城市排序的员工全名以及毕业和薪水。这是我的代码:
import duckdb
con = duckdb.connect(database=':memory:')
con.execute("""
select
a.CONCAT(FirstName , ' ' ,LastName) as FullName,
b.GradID,
b.Salary
from
T_Emp a
full join
T_Grad b
on
a.GradID = b.GradID
order by City;
""").df()
我得到的错误:
ERROR:root:An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 0))
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-30-85b9d80141b2> in <module>()
11 a.GradID = b.GradID
12 order by City;
---> 13 """).df()
RuntimeError: Catalog Error: Schema with name a does not exist!
LINE 3: a.CONCAT(FirstName , ' ' ,LastN...
您对连接字符串的查询有误,请按以下方法解决:
CONCAT(a.FirstName , ' ' ,a.LastName) as FullName