gpt4 book ai didi

Mysql - 如何从表中获取唯一的 dd-mm-YY?

转载 作者:行者123 更新时间:2023-11-29 00:13:59 24 4
gpt4 key购买 nike

结构表:

date                   text
2014-11-01 12:23 test words
2014-11-01 12:23 test words
2014-11-02 12:23 test words
2014-11-01 12:23 test words
2014-11-03 12:23 test words
2014-11-01 12:23 test words
2014-11-04 12:23 test words
2014-11-04 12:23 test words
2014-11-07 12:23 test words



SELECT * FROM TABLE GROUP by date

但此查询不是以 dd-mm-YY 格式获取唯一日期...

请告诉我如何从此表中获取唯一日期 dd-mm-YY?

P.S.:结果应该是下一个:

2014-11-07
2014-11-04
2014-11-03
2014-11-02
2014-11-01

最佳答案

SELECT DISTINCT DATE(date) FROM table;

关于Mysql - 如何从表中获取唯一的 dd-mm-YY?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23602949/

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