目前我有这三个表,结构非常相似
table1:id1 name1
table2:id2 name2
table3:id3 name3
我想要的结果将是
name1 name2 name3
value1 value2 value3
我尝试使用联合,sql是:
select name1 from table1 where id1 = '1'
union select name2 from table2 where id2 = '2'
union select name3 from table3 where id3 = '3'
但结果是:
name1
value1
value2
value3