Select previous row mysql?

后端 未结 5 1190
猫巷女王i
猫巷女王i 2021-01-27 10:11

If I have a mysql table which had primary ids and another field called gameScore can I do something along the lines of...

SELECT gameScore FROM table1 WHERE id =         


        
5条回答
  •  逝去的感伤
    2021-01-27 10:30

    looks funny - but maybe this is what you're after.

    select max( gameScore )
    from table1
    where id = 100
    and gameScore < ( select max( gameScore ) from table1 where id = 100 )
    

提交回复
热议问题