I am sorting a table based on the name column, but it is not sorting properly.
It is sorting like this :- First 20 rows based on alphabetical order and after that it is again sorting based on alphabetical order.
This is my query
select Name,ID from tbl_book order by Name Limit 0,100
and this is what i am getting
abcd|2
bgry|3
...
...
zref|100
agtr|4
dret|10
...
...
any one know why this is happening.
UPDATE
ID int(11)
Name varchar(255)
Its answer is
select ltrim(Name),ID from tbl_book order by 1 Limit 0,100
Given By TUXUDAY..
Try this query:
or there could be a problem with collation of data. try this also: