How to select last 3 minutes' records from MySQL with PHP

前端 未结 2 1270
忘掉有多难
忘掉有多难 2020-12-09 02:19

this is my SQL table:

+----------------+----------------+-----------+------------------------+ 
|   User_Name    |    Password    |    IP     |        Login_         


        
2条回答
  •  情话喂你
    2020-12-09 03:19

    This query will work even if your table is not updated...

    select * from myTable where Login_time > select max(time) - interval 3 minute ;
    

提交回复
热议问题