Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下情况:
两张表,它们的结构是这样的:
[机器](父表):
machine_id (PK) | machine_name | desc
[machine_in_out](子表):
id (PK) | machine_in_id | machine_out_id
现在我想通过父表获取machine_in_id,的名称。machine_out_id
machine_in_id
machine_out_id
如何使这个加入?!
尝试这个...
Select mio.ID, m1.machine_name, m2.machine_name From [machine_in_out] mio Join [machine] m1 On mio.machine_in_ID = m1.machineID Join [machine] m2 On mio.machine_out_ID = m2.machineID