gpt4 book ai didi

mysql - 根据时间戳从新到旧排列数据

转载 作者:行者123 更新时间:2023-11-29 14:09:30 25 4
gpt4 key购买 nike

您好,我做了一个查询,其中我根据当前日期排列数据,但问题是结果以较旧到较新的形式出现。我怎样才能通过从新到旧来实现这一目标。这是我的查询

$date = "select CAST(post_date AS DATE) AS dated from wp_hdflvvideoshare  group by dated order by (DATE_SUB(CURDATE(), INTERVAL 20 DAY))";
$date_sql=$wpdb->get_results($date);

就像我得到的结果形式为

oct nov dec

我想要它

dec nov oct

最佳答案

试试这个::

select CAST(post_date AS DATE) AS dated from wp_hdflvvideoshare  group by dated 
order by dated desc

关于mysql - 根据时间戳从新到旧排列数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13740717/

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