Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
Posted
Comments
Am Gayathri 4-Mar-13 2:35am    
Column A values (ABC..)
Column B values(XYZ..)
RajeshRaushan 4-Mar-13 2:38am    
Can you provide what exactly you have written?

Did you try and see what you get if you do:
SQL
ORDER BY columnB, columnA
 
Share this answer
 
Comments
Am Gayathri 4-Mar-13 3:47am    
Thanks a lot..i never thought this way...thanks
Go through this link - It will help you understand this:

Sort two columns with different ordering
 
Share this answer
 
v2
Comments
Am Gayathri 4-Mar-13 3:48am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900