0

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

$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);

就像我得到结果一样

十月 十一月 十二月

我想要它

十二月 十一月 十月

4

2 回答 2

1

试试这个 ::

select CAST(post_date AS DATE) AS dated from wp_hdflvvideoshare  group by dated 
order by dated desc
于 2012-12-06T09:48:46.030 回答
0
 $date = "select CAST(post_date AS DATE) AS dated
          from wp_hdflvvideoshare
          group by dated
          order by dated DESC";
于 2012-12-06T09:47:09.840 回答