Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
HiI have a table where I want fo show some rows and order by 2 columns, so I did this...
SELECT TOP 100 PERCENT Model, UserID, ArtnrDescriptionFROM dbo.tbl_ShoppingCartWHERE (UserID = N'123456')ORDER BY Model, ArtnrDescription
But it only sort the model column, the artnrdescription is still unordered.What am I doing wrong?
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts
Posted - 2010-04-26 : 01:17:48
The Query looks quites good! I think the problem on your data.Post your sample data and expected result.Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2010-04-26 : 01:23:43
or maybe you are using case-sensitive collation and you are expecting it to order by regardless of case ?KH[spoiler]Time is always against us[/spoiler]
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2010-04-26 : 01:32:12
in any case you need to show us some data and explain what you want and what you actually expect------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
magmo
Aged Yak Warrior
558 Posts
Posted - 2010-04-26 : 01:50:50
Sorry for this, I guess it's little to early for me in the morning and my eyes are playing tricks on me, the models had so simular names that it looked like the order by didn't work, but after some cofee I see that there was nothing wrong.... again, sorry :-|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2010-04-26 : 01:54:16
no problem..It happens to all.. ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/