Home > database >  The couple built simple table under question...
The couple built simple table under question...

Time:09-21

Select from the bottom to put data into a new table with what SQL statements,
The select c.f actno
Anderson, dno
A.e mplno_new
A.e MPLNM
A.e nterdt
A.e addr
C.d eptno
C.d eptnm
B.k indid
Anderson ns_user
Anderson ns_date
A, the FROM hrs100t0 hrs110t0 b, hrs006t0 c
Where Anderson, dno=b.i dno
And b.d eptid=c.d eptid
And b.g radseq=1 - the current positions information
And b.s top_date is null, on-the-job personnel


This is the new watch
The create table HRS100T0_TEST
(
FACTNO VARCHAR2 (4) not null,
IDNO VARCHAR2 (20) not null,
EMPLNO_NEW VARCHAR2 (8),
EMPLNM VARCHAR2 (30),
ENTERDT VARCHAR2 (8),
EADDR VARCHAR2 (60),
DEPTNO VARCHAR2 (8),
DEPTNM VARCHAR2 (30),
KINDID VARCHAR2 (1) not null,
INS_USER VARCHAR2 (20),
INSDATE DATE,
MEMO VARCHAR2 (2000)
)
Problem will be a bit retarded - -

CodePudding user response:

Insert into HRS100T0_TEST (
Idno
, emplno_new
, emplnm
, enterdt
, eaddr
Deptno,
, deptnm
, kindid
, ins_user
, insdate
)
The select c.f actno
And Anderson, dno
, a.e mplno_new
, a.e MPLNM
, a.e nterdt
, a.e addr
The c.d eptno
The c.d eptnm
, b.k indid
And Anderson, ns_user
And Anderson, ns_date
A, the FROM hrs100t0 hrs110t0 b, hrs006t0 c
Where Anderson, dno=b.i dno
And b.d eptid=c.d eptid
And b.g radseq=1 - the current positions information
And b.s top_date is null, on-the-job personnel

CodePudding user response:

 
Insert into HRS100T0_TEST (
Idno emplno_new, emplnm, enterdt eaddr, deptno
, deptnm kindid ins_user, insdate
)
The select c.f actno, Anderson, dno, a.e mplno_new, a.e MPLNM, a.e nterdt, a.e addr, c.d eptno
The c.d eptnm, b.k indid, Anderson ns_user, Anderson ns_date
A, the FROM hrs100t0 hrs110t0 b, hrs006t0 c
Where Anderson, dno=b.i dno
And b.d eptid=c.d eptid
And b.g radseq=1 - the current positions information
And b.s top_date is null, on-the-job personnel

CodePudding user response:

Upstairs two, in addition to other table when the table was being built in the data is copied, for example: create table as the select * from A, B

CodePudding user response:

CodePudding user response:

If a table like table b of table structure, why not directly
The create table b as select * from a, if as long as the table structure, not the data, where0=1 is added to it
  • Related