我想從ms sql server中使用pyodbc獲取數據。我得到以下錯誤:您的SQL語句的某些部分嵌套得太深.. pyodbc
ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries. (191) (SQLExecDirectW)')
代碼如下:
conn = pyodbc.connect('DRIVER={SQL Server};SERVER=127.0.0.1;DATABASE=Morphemes;')
cursor = conn.cursor()
Func = list()
sql_VerbDecl = "SELECT (stem_.kök + conj_.suffix) as tokenn FROM TBL_Stem as stem_ INNER JOIN TBL_VerbDecl as conj_ on conj_.node = stem_.node;"
cursor.execute(sql_VerbDecl)
rows = cursor.fetchall()
的問題是一個統一的問題。當我將stem_.kök更改爲stem_.kok時,問題解決了。