SQL
1,SELECT Company, OrderNumber FROM Orders
ORDER BY Company DESC, OrderNumber ASC
?如何确定这个Company与OrderNumber的优先级呀?也就是说,若以Company排好序后,再以OrderNumber排序,可能会影响前面Company的排序结果,这种情况下,如何处理?是以第一个条件为优先么?
找到了下面这句话:Notice that there are two equal company names (W3Schools) in the result above. The only time you will see the second column in ASC order would be when there are duplicated values in the first sort column, or a handful of nulls.(注意:在刚才的结果中有两个相同的公司名“W3School”。也只有在当第一个排序列中有重复项或多个空值时,才会在第二列的结果中以ASC的形式显示。)