I want to select * from tbl
order by characters, for example:
a) 1 coloum has a
b) 1 coluum has ab
I want it to place ab
first and then a
I want to select * from tbl
order by characters, for example:
a) 1 coloum has a
b) 1 coluum has ab
I want it to place ab
first and then a
In SQL Server:
select * from tbl
order by len(col) desc
where tbl
is your table and col
is the column.
This returns the results ordered by the length of col
, longest first.
Sql takes care of length of the coleumn, simply select * from tbl order by col desc