我有一个表,其中包含三个数据类型字段date
, int
and bigint
.
我想使用所有这三列对我的选择查询进行排序。我想将它们全部按降序排列。例如:
Select * From mytbl
order by date desc,intnum desc, bigintnum desc;
我是否可以从所有三列的最大值开始得到结果。
例如最新日期、最高 intnum 和最高 bigintnum。
no
您的查询所做的是获取max date
,随后是max intnum
of the max date
接下来是max bigintnum
of the max intnum
of the max date
换句话说,您的查询不会返回所有三列的最大值
它首先按日期排序,然后是 intnum,然后是 bigintnum
结果会是这样的
2011-07-20 12 14
2011-07-20 12 13
2011-07-20 11 16
2011-07-20 10 12
2011-07-19 20 15
2011-07-18 60 30
2011-07-18 50 14
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)