We generally cannot order the records for a column with character data type. Please use the following trick to use the order clause:
select employee_number from employees
order by lpad(employee_number,100);
Using the lpad the zeros would be appended and then sql will treat them as numbers and the employee number would be sorted.
Thursday, October 22, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment