i am trying to sort mysql data with alphabeticaly like
A | B | C | D
when i click on B this query runs
select name from user order by \
Wildcard Characters are used with like clause to sort records.
if we want to search a string which is starts with B then code is like the following:
select * from tablename where colname like 'B%' order by columnname ;
if we want to search a string which is ends with B then code is like the following: select * from tablename where colname like '%B' order by columnname ;
if we want to search a string which is contains B then code is like the following: select * from tablename where colname like '%B%' order by columnname ;
if we want to search a string in which second character is B then code is like the following: select * from tablename where colname like '_B%' order by columnname ;
if we want to search a string in which third character is B then code is like the following: select * from tablename where colname like '__B%' order by columnname ;
note : one underscore for one character.