Click here to Skip to main content
15,878,871 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am using pivot and pivot sorting data in asc order
IT must use pivot in SQL Query .

Got Result:
******************************
Columns ModelData
---------------------
Ex. ShowRoom Price
Extended Warranty
Hypothication
IMV Charges
Insurance
Insurance_dep
Insurance_pp
Octroi (PCMC)
On Road Price
Other Accessories
Registration Charges
RSA
Smart Card Charges
STD Accessories
Total Price
---------------------------

*************************************
as above ModelData Columns it display in alphabetically order .
i don't want it in sorting asc or desc manner.

My Output have in below manner (i.e. unsorted/disorder manner )
------------------------------------------
Model Type:	
Ex. Showroom Price:	
Insurance 0%DEP+P.P:	
Registration Charges:	
Extended Warranty	
Smart Card Charges:	
Hypothication:	
Octroi (PCMC)	
On Road Price:	
RSA	
IMV Charges:	
STD Accessories:	
Others Accessories:	
Total Price:	
---------------------------------------
Thanks in Advance
Posted
Updated 9-Dec-14 8:34am
v2
Comments
Tomas Takac 9-Dec-14 8:35am    
Please post the SQL query. You can apply any sorting order you want, where is the catch?
Jörgen Andersson 9-Dec-14 10:39am    
Since Pivot uses an aggregation internally it will be ordered in some way whether you want it or not, but it might be fixed by adding a Row_Number to sort by before the actual pivot. Please update your question with the query you're using and what is deciding the order of the output if you don't do any order by.
ZurdoDev 9-Dec-14 14:43pm    
As mentioned, click Improve question and show your sql.

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