由于某种原因,以下代码仅返回10行而不是20行的数据帧(SQL视图中有数百万行)。 当我查看print(data2)的输出时,它将前10行显示为DataFrame,但下一个DataFrame为空。
import cx_Oracle as cx
import pandas as pd
conn = cx.Connection("username/pwd@server")
data = pd.DataFrame([])
SQL1 = '''SELECT * FROM TABLE_MV where rownum between '''
for i in range(1, 20, 10):
lower = i
upper = i+9
SQL3 = SQL1 + str(lower) + ' and ' + str(upper)
data2 = pd.read_sql(SQL3, conn)
print(data2)
data = data.append(data2)