I have a query, I have to sort the result from the DB2 database. The query will select the columns empname,salary,status
. But I have to sort the result using order by empno
But the query is not working.. This is the query.
select empname, salary, status from emp where salary>5000 order by empno
Can you update the query to sort by empno
without using it in selecting columns?
Your syntax seems correct to me except dot(.) at the end. After removing dot if doesn't work...
Try something like
SELECT empname, salary, status
FROM (SELECT *
FROM emp
ORDER BY empno)
WHERE salary > 5000