worker表 工人表
create table worker --务工人员表
(
worker_Id int primary key not null, --务工人员id
worker_Name varchar2(20) not null, --务工人员真实姓名
sex int not null, --性别
living_Place int references region(region_Id) not null, --现居住地
hu_Ji int references region(region_Id) not null --户籍
)
create table region --行政区划(省,市,区县)
(
region_Id int primary key not null, --行政区划 id
region_Name varchar2(40) not null --行政区划名称
)怎么样一次查出居住地名称和户籍名称呢?我建的报 "未明确定义列" 错误
create table worker --务工人员表
(
worker_Id int primary key not null, --务工人员id
worker_Name varchar2(20) not null, --务工人员真实姓名
sex int not null, --性别
living_Place int references region(region_Id) not null, --现居住地
hu_Ji int references region(region_Id) not null --户籍
)
create table region --行政区划(省,市,区县)
(
region_Id int primary key not null, --行政区划 id
region_Name varchar2(40) not null --行政区划名称
)怎么样一次查出居住地名称和户籍名称呢?我建的报 "未明确定义列" 错误
解决方案 »
- sql循环功能:出现符号"@"在需要下列之一时
- Corrupt block relative dba: 0x01400083 (file 5, block 131)
- oracle中的varchar2(100 char)是什么类型
- 关于oracle查询分页的问题
- 指标报表数据的深度求解: 部门参数信息,部门指标数据。这两类参数信息都是表里动态的
- 关于DataBase Link (数据库连接)问题求教
- oracle的字符串处理有哪些函数??多谢了:))
- 如何删除某个用拥有的所有对象???急...............
- oracle 中修改字符集的问题
- sqlserver数据导入到oracle8i的问题!!!???
- 问一个有关DBMS_JOB的问题
- 关于pl/sql的小问题
(
region_Id int primary key not null,
region_Name varchar2(40) not null
);
create table worker
(
worker_Id int primary key not null,
worker_Name varchar2(20) not null,
sex int not null,
living_Place int references region(region_Id) not null,
hu_Ji int references region(region_Id) not null
);select w.worker_Id
, w.worker_Name
, r.region_Name living_Place
, r.region_Name hu_Ji
from worker w
, region r
where w.living_Place = r.region_Id;
select worker_id, worker_name, (select region_Name from region b where b.region_id = a.living_place) living_Place,(select region_Name from region b where b.region_id = a.hu_ji) hu_ji from worker a
select w.worker_Id
, w.worker_Name
, a.region_Name living_Place
, b.region_Name hu_Ji
from worker w inner join region a
on w.living_Place = a.region_Id
inner join region b
on w.living_Place = b.region_Id