我有两张桌子,
sales_olap
和
resellers
我需要打印出转售商的来源
销售业务
不存在于
转售商
桌子
例如:
result = cursor.execute("SELECT SO.reseller_name FROM sales_olap AS SO WHERE
SO.reseller_name!=(SELECT reseller FROM resellers)")
for row in result:
print row
但我犯了个错误:
1242, Subquery returns more than 1 row
我怎样才能让它只打印经销商的名字
销售业务
它们不存在的表
转售商
桌子?
如果我试着做:
result = cursor.execute("SELECT reseller_name FROM sales_olap WHERE reseller_name NOT IN(SELECT reseller FROM resellers)")
for row in result:
print row['reseller_name']
然后我得到错误:
TypeError: 'long' object is not iterable