Home » MYSQL » MySQL ORDER BY » Question
  1. Is there any error in the following query?
    SELECT emp_id, title, start_date, fname, fed_id
    FROM Employee
    ORDER BY LEFT (fed_id, 5);
    1. Depends
    2. Yes
    3. No error
    4. All of above
    5. None of these
Correct Option: C

“ORDER BY” clause can be used with expression such as fed_id which is a social security no like 111, 111, 111 therefore we sort it taking only 5 digits from left.



Your comments will be displayed only after manual approval.