Python mysql-double fetching literal for int base 10 error

时间:2018-03-29 11:12:03

标签: python mysql python-3.x

我正在尝试从mysql接收DOUBLE值。

我有这个mysql表“fxvalues”结构

Y1 -DOUBLE
X1 -DOUBLE
X2 -DOUBLE
...
X8 - DOUBLE

然后我在python上运行此代码

queryvals=("SELECT Y.col1 as Y1,X.col1 as X1,X.col2 as X2,X.col3 as X3,X.col4 as X4,X.col5 as X5,X.col6 as X6,X.col7 as X7,X.col8 as X8 from fxvalues as Y, (SELECT * from fxvalues where interfaz_id="+str(Y_interfaz_id)+
            " ) as X where Y.interfaz_id="+str(id)+" and Y.day=X.day and Y.year=X.year and Y.month=X.month and Y.hour=X.hour and Y.min=X.min");

cursor2 = cnx.cursor();                                                    
cursor2.execute(queryvals);

for (Y1,X1,X2,X3,X4,X5,X6,X7,X8) in cursor:                
    print("Start");
    #print(str(float(Y1))+"  "+str(float(X1))+"  "+str(float(X2)));


cursor2.close();

我在for (Y1....) in cursor上收到此消息:

  

ValueError:基数为10的int()的文字无效:   b'48.047454833984375'

任何想法??

0 个答案:

没有答案