表A:
equ equ_time
jingche 11
roughlathe 8
milling 12
////////////////////////////
表B:
equ equ_number
jingche 3
milling 2
roughlathe 5
///////////////////////////
表C:
model no time equ
a 1 5 routhlathe
a 2 11 jingche
b 1 9 roughlathe
c 1 3 roughlathe
c 2 7 jingche
d 1 8 roughlathe
d 2 10 jingche
d 3 2 milling
////////////////////
表D:
model model_number
a 25
c 20
b 20
d 15////////////////////////////////////////////////////
select c.model,no,time,equ,model_number
from C,D
where C.model=D.model
得到:
model number no time equ
a 25 1 5 routhlathe
a 25 2 11 jingche
b 20 1 9 roughlathe
c 20 1 3 roughlathe
c 20 2 7 jingche
d 15 1 8 roughlathe
d 15 2 10 jingche
d 15 3 2 milling 我想知道如何再根据表C中的,equ字段=A,B中的equ字段,加上在上表中加上A,B表中的equ_time,equ_number
而得到下面的表:
model number no time equ equ_time equ_number
a 25 1 5 routhlathe 11 3
a 25 2 11 jingche 8 2
b 20 1 9 roughlathe 11 3
c 20 1 3 roughlathe 11 3
c 20 2 7 jingche 8 2
d 15 1 8 roughlathe 11 3
d 15 2 10 jingche 8 2
d 15 3 2 milling 12 5
我用下面的语句
select c.model,c.number,c.no,c.time,c.equ,a.equ_time,b.equ_number
from a,b,c,d
where c.model=d.model and c.equ=a.equ and c.equ=b.equ
发现没有得到结果,怎么回事,请各位指教!!!
先谢谢了!
equ equ_time
jingche 11
roughlathe 8
milling 12
////////////////////////////
表B:
equ equ_number
jingche 3
milling 2
roughlathe 5
///////////////////////////
表C:
model no time equ
a 1 5 routhlathe
a 2 11 jingche
b 1 9 roughlathe
c 1 3 roughlathe
c 2 7 jingche
d 1 8 roughlathe
d 2 10 jingche
d 3 2 milling
////////////////////
表D:
model model_number
a 25
c 20
b 20
d 15////////////////////////////////////////////////////
select c.model,no,time,equ,model_number
from C,D
where C.model=D.model
得到:
model number no time equ
a 25 1 5 routhlathe
a 25 2 11 jingche
b 20 1 9 roughlathe
c 20 1 3 roughlathe
c 20 2 7 jingche
d 15 1 8 roughlathe
d 15 2 10 jingche
d 15 3 2 milling 我想知道如何再根据表C中的,equ字段=A,B中的equ字段,加上在上表中加上A,B表中的equ_time,equ_number
而得到下面的表:
model number no time equ equ_time equ_number
a 25 1 5 routhlathe 11 3
a 25 2 11 jingche 8 2
b 20 1 9 roughlathe 11 3
c 20 1 3 roughlathe 11 3
c 20 2 7 jingche 8 2
d 15 1 8 roughlathe 11 3
d 15 2 10 jingche 8 2
d 15 3 2 milling 12 5
我用下面的语句
select c.model,c.number,c.no,c.time,c.equ,a.equ_time,b.equ_number
from a,b,c,d
where c.model=d.model and c.equ=a.equ and c.equ=b.equ
发现没有得到结果,怎么回事,请各位指教!!!
先谢谢了!
select c.model,c.number,c.no,c.time,c.equ,a.equ_time,b.equ_number
from a,b,c,d
where rtrim(c.model)=rtrim(d.model)...