gpt4 book ai didi

mysql - 如何使用 MySQL 命令显示数据库中最后一分钟(即当前分钟)的行?

转载 作者:行者123 更新时间:2023-11-29 20:10:57 24 4
gpt4 key购买 nike

mysql> SELECT * FROM master_name;

+---------+---------------------+---------------------+-----------+----------+
| name_id | name_dateadded | name_datemodified | firstname | lastname |
+---------+---------------------+---------------------+-----------+----------+
| 1 | 2001-10-29 13:11:00 | 2001-10-29 13:11:00 | John | Smith |
| 2 | 2001-10-29 13:11:00 | 2001-10-29 13:11:00 | Jane | Smith |
| 3 | 2001-10-29 13:11:00 | 2001-10-29 13:11:00 | Jimbo | Jones |
| 4 | 2001-10-29 13:11:00 | 2001-10-29 13:11:00 | Andy | Smith |
| 7 | 2001-10-29 14:16:21 | 2001-10-29 14:16:21 | Chris | Jones |
<小时/>

预期输出:

| 7 | 2001-10-29 14:16:21 | 2001-10-29 14:16:21 | Chris  | Jones |

最佳答案

SELECT t.*
FROM master_name
WHERE id = (SELECT MAX(name_id) FROM master_name)

关于mysql - 如何使用 MySQL 命令显示数据库中最后一分钟(即当前分钟)的行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40122255/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com