-
what is SQL sorting based on?
Hello, I'm a software tester and wish to know the exact rules apply to sql sorting.
If you do something like
SELECT * FROM tablename ORDER BY column ASC
suppose the column is a text field - varchar (50), how does it sort?
For example
I have the following data:
New Comment Category
New Comment Category1
New Comment Category3
JKLM
ABCabc1234567890
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx
DevelopmentOfIdeas
Overall
Reasoning
~!@#$%^&*()_+{}|:"<>?`-=[]\;',./
<CommentCategory>
WHEN SORTED, they look like this:
JKLM
<CommentCategory>
ABCabc1234567890
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx
DevelopmentOfIdeas
New Comment Category
New Comment Category1
New Comment Category3
Overall
Reasoning
~!@#$%^&*()_+{}|:"<>?`-=[]\;',./
I know the sorting by default is case-insensitive. but what about the rules on the special characters? i don't understand why some special character gets placed in front of others? it's definitely not how the ascii table is sorted.
Could someone give me an explanation or point me to the right direction?
thanks!
-
< = ASCII 60
~ = ASCII 126
-
what about J?
ascii 74.. placed in front of < ??
-
never mind
there is a space in front of that
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|