I am doing a query in my database to calculate an average and I use the avg()
. My problem is that it returns a lot of numbers after the comma, how can I reduce this to just one or two values after the comma?
Home
/
user-6549
Coloma's questions
Coloma
Asked:
2020-05-16 19:53:58 +0800 CST
I am trying to insert into a table. This is the code I made:
cursor=connection.cursor()
cursor.execute('INSERT INTO TopOperadores (imsi_pref_top,descarga_top,transferencia_top) VALUES (SELECT imsi_num, AVG(descarga), AVG(transferencia) FROM Trafico_de_Datos group by nomb_oper)')
This is the error:
syntax error at or near "SELECT" LINE 1: ..._pref_top,download_top,transfer_top) VALUES (SELECT ims...
Coloma
Asked:
2020-05-13 10:02:39 +0800 CST
They told me that this is specified when opening the file but I don't know how to put it:
open(path, "rU")