- 论坛徽章:
- 0
|
1. Display the last name, department number, and job ID of all employees whose department location ID is 1700.
标准答案:
SELECT last_name, department_id, job_id
FROM employees
WHERE department_id IN (SELECT department_id
FROM departments
WHERE location_id = 1700);
我的答案
select e.last_name,e.department_id,e.job_id
from employees e,departments d,locations l
where e.departments_id=d.department_id
and d.location_id=l.location_id
and l.location_id=1700;
不明白的就是用标准答案里的子查询查出来的department怎么用到主查询中呢?这句子查询用到主查询中如何理解?
2. 如何查看约束作用于哪个字段?用desc查user_constraints查看,一个一个select查看过来没有一个能看到约束作用在那个字段上?
不知道大家平常怎么看的?
3. alter table set column1 unused
用了这句后怎么恢复啊 用 alter table set column1 used 好像不行,翻了几本教科书都找不到。
4. plsql 常常明明有错误报 ,show errors 却是 no errors ? 这个问题比较普通一些。
[ 本帖最后由 samhugh 于 2009-6-26 14:27 编辑 ] |
|