-
-
Save itanium21/e2389e9e454d2cd8167a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#player_id, name un i (līmenis) tiek padots | |
cursor.execute("SELECT score FROM scores WHERE level="+str(i)+" AND player_id="+player_id) | |
score=cursor.fetchone()[0] | |
cursor.execute("SELECT COUNT(1) FROM scores WHERE score>="+ str(score) + " AND level="+str(i)) | |
count_1=cursor.fetchone()[0] | |
cursor.execute("SELECT timestamp FROM scores WHERE level="+str(i)+ " AND player_id="+player_id) | |
timestamp=cursor.fetchone()[0] | |
cursor.execute("SELECT COUNT(1) FROM scores WHERE level="+str(i) +" AND score=" + str(score) + " AND timestamp<'"+str(timestamp)+"'") | |
count_2=cursor.fetchone()[0] | |
cursor.execute("SELECT COUNT(1) FROM players JOIN scores ON scores.player_id=players.id WHERE level="+str(i)+" AND score="+str(score)+" AND timestamp='"+str(timestamp)+"' AND name < '"+ name +"'") | |
count_3=cursor.fetchone()[0] | |
app.logger.info(int(count_1)-int(count_2)-int(count_3)) #rezultāts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment