所以我有这些表:
SQL> select * from project;
PNAME PNUMBER PLOCATION DNUM
--------------- ---------- --------------- ----------
Virtualization 40 Houston 5
CRM 50 Stafford 4
Bladeservers 60 Houston 1
ProductX 1 Bellaire 5
ProductY 2 Sugarland 5
ProductZ 3 Houston 5
Computerization 10 Stafford 4
Reorganization 20 Houston 1
Newbenefits 30 Bellaire 4
9 rows selected.
SQL> select * from dept_locations;
DNUMBER DLOCATION
---------- ---------------
1 Houston
4 Stafford
5 Bellaire
5 Houston
5 Sugarland
30 Norfolk
30 Suffolk
7 rows selected.
如果任何部门位置与项目中的dnum匹配,我需要创建一个检查plocation和dlocation的新列ptype并将ptype设置为LOCAL,否则结果应为REMOTE。关于如何做到这一点的任何线索?谢谢,