我如何在oracle中订购多个coloumn? [英] How can i order more than one coloumn in oracle?
问题描述
我正在使用一个程序来检索数据。结果包含两个字段,让我们考虑列A和列B
现在出来看起来像,
A栏B栏
AX
BX
CX
by
CY
AY
CZ
AZ
BZ >
这里按B栏排序,但我需要输出如
A栏B栏
AX
BX
CX
AY
B Y $ / $
CY
AZ
BZ
CZ
这是一件具有挑战性的事情吧?
请帮我这样做。
如果你需要更多的澄清,现在让我。
Am using one procedure to retrieve data.The result contains two fields, lets consider Column A and Column B
now out put looks like,
Column A Column B
A X
B X
C X
B Y
C Y
A Y
C Z
A Z
B Z
Here am ordered by Column B, But i need output like
Column A Column B
A X
B X
C X
A Y
B Y
C Y
A Z
B Z
C Z
Its a challenging thing right?
Please please help me to do this.
Let me now if you need more clarification.
推荐答案
你有没有试过看看你得到了什么:
Did you try and see what you get if you do:
ORDER BY columnB, columnA
通过此链接 - 它将帮助您理解这一点:
按不同的顺序对两列进行排序
Go through this link - It will help you understand this:
Sort two columns with different ordering
这篇关于我如何在oracle中订购多个coloumn?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!