Sir, I have a Table name tbl_Employee
the Colums to this table is emp.Id, lastname,firstName,middleName,jobId,managerId,hireDate, salary,commission,departmentId
I want to display all details in ASC order according to lastName and Salary in DESC order.
Is this possible?. if yes, send me the code.
Loading


Pankaj PandeyRank #642 · 3.7K reputationPosted Jun 5, 2013, 11:46 PM EDT
select * from tbl_Employee order by lastName asc, Salary desc
Pankaj PandeyRank #642 · 3.7K reputationPosted Jun 5, 2013, 11:07 PM EDT
select * from tbl_Employee order by Salary desc,lastName asc
Bineesh ViswanathRank #1,681 · 907 reputationPosted Jun 5, 2013, 11:38 PM EDT
but the lastName ASC is not working in output.
The output is:-
employeeId lastName firstName middleName jobId managerId hireDate salary comm departmentId
---------------- -------------------- -------------------- -------------------- ---------------- ---------------- ----------------------- ---------------- ----------- ----------------
7505 DOYLE JEAN K 671 7839 4/4/1985 2850
7506 DENNIS LYNN S 671 7839 10/5/1985 2750
7507 BAKER LESLIE D 671 7839 9/6/1985 2200
7499 ALLEN KEVIN J 670 7698 12/4/1984 1600 300 30
7521 WARK CYNTHIA D 670 7698 4/2/1985 1250 500 30
7369 SMITH JOHN Q 667 7902 12/5/1984 800
please send me the corrected code
Bineesh ViswanathRank #1,681 · 907 reputationPosted Jun 6, 2013, 12:10 AM EDT