假设我有以下表格:
表A
id|first_name|sport
1 | alice | swimming
2 | bob | basketball
3 | casey | baseball
表B
name | hobby
alice | running
bob | null
我想得到一个类似于 tableA 但附加列的输出表:
id | first_name | sport | theirhobby
1 | alice | swimming | running
2 | bob | basketball | null
3 | casey | baseball | null
请注意,names 列的名称从 tableA 中保留,并且附加到 tableA 的唯一新列是爱好。