【发布时间】:2020-10-25 08:10:43
【问题描述】:
当我尝试在 google colab 中运行以下代码时:
#Get required Data
data8 = pd.read_sql_query('''SELECT Person.Name, Person.Gender
FROM M_Cast left JOIN Person USING (PID)
WHERE PID NOT IN
(
SELECT DISTINCT(PID) as PID
FROM
(
SELECT *, LEAD(M_year, 1, 0) OVER (PARTITION BY Actor ORDER BY M_year ASC) AS N_Year
FROM
(
SELECT trim(person.PID) as PID, trim(Person.Name) as Actor, substr(Movie.year,length(Movie.year)-3,4) as M_Year
FROM Person
LEFT JOIN M_Cast USING (PID)
LEFT JOIN Movie USING (MID)
)
)
WHERE (N_Year-M_Year)>3
)''',con)
print('Output 8: Following is the list of actors never unemployed more than 3 years.(Included actors having single movie):\n')
data8
Colab 给我一个错误 DatabaseError:sql执行失败 : 靠近 "(": 语法错误
虽然它在我的 jupyter notebook 上运行良好
【问题讨论】:
-
失败代码的行号是多少?