I want an output like first name of employees in ascending order, but it should start with name 'jack' then rest of the name in ascending order'.
Output should be like this,
Jack
Anto
Becky
Carrry
Dominic
Emil
.
.
....
zen
I want an output like first name of employees in ascending order, but it should start with name 'jack' then rest of the name in ascending order'.
Output should be like this,
Jack
Anto
Becky
Carrry
Dominic
Emil
.
.
....
zen
Please try
Select firstname from employees Order by
case when firstname like 'jack' then 0 else 1 end, firstname ASC
SQL Fiddle demo at http://sqlfiddle.com/#!2/768d0/10
You can also try the below query
SELECT
myname
FROM
names
ORDER BY
myname not like 'jack',
myname;