python - MySQLdb return average of results -


its possible return average of selected data using mysql, can't seem using mysqldb, code follows

cursor = database.cursor()  cursor.execute ("select avg(points) table entry =%s , id =%s", (e_id, g_id)) average = cursor.fetchone() print average 

would know how this..?

edit: error getting 1064, "you have error in sql syntax...


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -