select bt.transaction_id,
bt.datetime,
l1.location_name as location_1_name,
l2.location_name as location_2_name,
l3.location_name as location_3_name
from base_table bt
left join location l1 on l1.location_id = bt.location_1
left join location l2 on l1.location_id = bt.location_2
left join location l3 on l1.location_id = bt.location_3
1条答案
按热度按时间wqlqzqxt1#
使用多个左连接: