我对sql还是很陌生,所以请耐心等待。.
我有一个包含22个表的数据库,所有表都与一个主键(产品编号)连接
我需要从所有与一个主键匹配的表中获取所有列。
今天我在查询中使用了这个
query = """ select * from pt_MatText where artikkelnummer = ?"""
cursor.execute(query,artNR)
pt_MatText = cursor.fetchall()
pt_MatText = list(pt_MatText[0]) #makes a list of the returned tuple
pt_MatText.pop(0) #Removes the primary key, so that im left with only the columns i want
我对我拥有的每张桌子都采用相同的方法(22) 似乎有点慢,所以可以改善从表中获取数据的方式以提高速度吗?还是一般素质? 另外,香港专业教育学院听说要避免使用游标。为什么会这样?