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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 order the result

Author  Topic 

acdacd
Yak Posting Veteran

63 Posts

Posted - 2005-08-14 : 03:41:02
I have a table
TableA
Col PK ColA
1 456
2 245
3 ged
4 anc


The colA is string.If i want to select tableA and get result as follow order. How to do ?

4 anc
3 ged
1 456
2 245




be a hardworking people!!

Stalker
Yak Posting Veteran

80 Posts

Posted - 2005-08-14 : 03:53:22
select * from table1 order by ColA desc

is it ?
Go to Top of Page

acdacd
Yak Posting Veteran

63 Posts

Posted - 2005-08-14 : 05:59:59
so simple!
But i want to know how to determined the order between number and string within string column by using the "order"?
If I the string is not english but other asian font, then how does it affect the result?

be a hardworking people!!
Go to Top of Page

Stalker
Yak Posting Veteran

80 Posts

Posted - 2005-08-14 : 07:36:21
at least russian letters behave in the same way...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-16 : 01:18:25
It is order by the ascii value of the string
So the ordered result depends on the ascii value

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

acdacd
Yak Posting Veteran

63 Posts

Posted - 2005-08-16 : 06:20:56
OIC, thanks

be a hardworking people!!
Go to Top of Page
   

- Advertisement -