首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

怎么按照降序排序时间

2012-03-21 
如何按照降序排序时间以下代码怎么才能改成以time为降序来排序时间PHP code$sql SELECT k.id, k.uid AS

如何按照降序排序时间
以下代码怎么才能改成以time为降序来排序时间

PHP code
$sql = "SELECT k.id, k.uid AS likeuid,k.time as ktime, b . * , m.username, m.domain                FROM `".DBPRE."likes` AS k                LEFT JOIN `".DBPRE."blog` AS b ON k.bid = b.bid                LEFT JOIN `".DBPRE."member` AS m ON b.uid = m.uid WHERE k.uid = '{$_SESSION['uid']}'";


[解决办法]
ORDER BY [TIME] DESC
[解决办法]
order time desc
[解决办法]
order by k.time desc
?
[解决办法]
order by ktime desc
[解决办法]
$sql = "SELECT k.id, k.uid AS likeuid,k.time as ktime, b . * , m.username, m.domain
FROM `".DBPRE."likes` AS k
LEFT JOIN `".DBPRE."blog` AS b ON k.bid = b.bid
LEFT JOIN `".DBPRE."member` AS m ON b.uid = m.uid WHERE k.uid = '{$_SESSION['uid']}' order by ktime desc";
[解决办法]
探讨
我就是想问 order by k.time desc放到哪个位置啊?

热点排行