【发布时间】:2021-08-31 11:43:15
【问题描述】:
我有一张表格,其中存储了学生录取详细信息和录取日期。录取日期分为多行,我想将三行中的值合并为一行。
select * from table
student_name student_value student_answer
Drake day 28
Drake month 2
Drake year 2010
Drake city San Diego
Drake zip code 11235
Josh day 15
Josh month 5
Josh year 2012
Josh city Sacramento
Josh zip code 45876
期望的结果(new_column):
student_name student_value student_answer new_column
Drake day 28 9282010
Drake month 9 9282010
Drake year 2010 9282010
Drake city San Diego San Diego
Drake zip code 11235 11235
Josh day 15 11152012
Josh month 11 11152012
Josh year 2012 11152012
Josh city Sacramento Sacramento
Josh zip code 45876 45876
【问题讨论】:
标签: sql postgresql