我需要使用pyodbc从三个不同表(A_BSC,A_BCF,A_BTS)的访问文件中提取某些内容 但始终在“内部联接”命令以下运行期间失败 那么在此模块中使用多内部联接是否适用?
text='F:\python\Draft\dump\Dump.mdb'
site_name="%0204UP%"
conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb,*.accdb)};DBQ='+text+';')
for BCF ,name,BSC_Nname,BTS_ID in conn.execute("SELECT A_BCF.BCFId ,A_BCF.name,A_BSC.NAME,A_BTS.BTSID FROM A_BCF INNER JOIN A_BTS ON A_BCF.BSCID=A_BTS.BSCID AND A_BCF.BCFID=A_BTS.BCFID INNER JOIN A_BSC ON A_BCF.BSCID=A_BSC.BSCID WHERE A_BCF.name LIKE ?",(site_name,)):
print("BCF_ID = ",BCF)
print("name = ", name)
print("BTS_ID = ", BTS_ID)
print("-"*40)