有两张表table1和table2。
已知table1的字段为:
ID
MachineName
CustomerLotID
state
status1
status2
Datetable2的字段为:
ID
CustomerLotID
State
Hifix
Bin现在我需要求table1的status1和status2的内容,当table1的CustomerLotID,state和table2的CustomerLotID,State相等的时候。
已知table1的字段为:
ID
MachineName
CustomerLotID
state
status1
status2
Datetable2的字段为:
ID
CustomerLotID
State
Hifix
Bin现在我需要求table1的status1和status2的内容,当table1的CustomerLotID,state和table2的CustomerLotID,State相等的时候。
a.status1,
a.status2
from
table1 a,
table2 b
where
a.CustomerLotID=b.CustomerLotID
and
a.State=b.State