在Oracle 10g中一起使用WHERE和ORDER BY

时间:2014-08-27 15:51:06

标签: sql oracle oracle10g

我的问题:选择除Clerk之外的所有员工的所有数据。按他们的姓氏排序 名称

我的查询:

select * from employees WHERE job_id NOT like '%CLERK' AND order by last_name

但它不起作用

1 个答案:

答案 0 :(得分:2)

删除AND

select * from employees 
WHERE job_id NOT like '%CLERK' 
order by last_name

根据评论,使用伪代码

select * from employees 
WHERE job_id != 'CLERKS'
AND DateAppointedFielName BETWEEN StartDate AND EndDate 
order by last_name