Data is not sorted even it has a priamry key

DATA IS NOT SORTED EVEN IT HAS A PRIMARY KEY.

PLEASE LET ME KNOW THE FUNDA BEHIND IT.

Because Brand_ID column is a string type ( varchar(12) ), the sorting is string sort. In string sort, comparison is done one character at a time, starting with the leftmost character. So 2 is greater than 1 in string sort. But 2 is greater than 10 as well.

DATA IS NOT SORTED EVEN IT HAS A PRIMARY KEY.

Having a primary key does not guarantee sort order in your query results. You have to add an ORDER BY clause to your query to make sure that it is sorted by whatever rule you want to use.

thanks for your response.