我有两张桌子。
第一个是branchesand 有列branchid和branchname其他。
第二个表是transfer并且有列fromid和toid其他( fromid 和 to id 是 branchid )
我想要一个查询来显示分支的名称。
现在我使用两个查询来做到这一点:
select branchname
from `transfer`, `branches`
where transfer.fromid = branches.branchid
另一个查询是
select branchname
from `transfer`, `branches`
where transfer.toid = branches.branchid