0

I'm using my phpmyadmin which is linked up to our CRM system where we can pull reports from our DB. I'm trying to return a report where the dates will be in descending order - however my query doesn't seem to be returning the order by command correctly.

Query I have is:

SELECT emp.emp_firstname as `first name` 
     , emp.emp_lastname as `last name`
     , emp.emp_work_email as `email` 
     , emp.custom6 as `Agency` 
     , emp.employee_id as `crewcode` 
     , emp.custom67 as `nationality`
     , emp.custom14 as `Salary options`
     , emp.custom15 as `Salary options comments`
     , emp.custom17 as `Salary options date of change`
     , emp.custom30 as `Bank Cert` 
FROM `hs_hr_employee` emp  
WHERE emp.custom61 LIKE "active-oam" 
ORDER by emp.custom17 DESC
4

1 回答 1

0
 SELECT emp.emp_firstname as `first name` 
 , emp.emp_lastname as `last name`
 , emp.emp_work_email as `email` 
 , emp.custom6 as `Agency` 
 , emp.employee_id as `crewcode` 
 , emp.custom67 as `nationality`
 , emp.custom14 as `Salary options`
 , emp.custom15 as `Salary options comments`
 , emp.custom17 as `Salary options date of change`
 , emp.custom30 as `Bank Cert` 
  FROM `hs_hr_employee` emp  
  WHERE emp.custom61 LIKE "active-oam" 
  ORDER by emp.custom17 DESC, emp.employee_id DESC

试试看

于 2013-06-05T11:24:59.390 回答