可能重复:
SQL“转换”查询
我不知道如何编写 SQL 语句以将表的不同值显示为单独的列...这是一个示例:
Table A - Project
= = = = = = = = = = = = = =
ID | Project
= = = = = = = = = = = = = =
1 | Google
Table B - Tasks
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
ID | Project ID | Task_name | Date Complete
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
1 | 1 | Build | 10/30/12
2 | 1 | Revise | 11/15/12
3 | 1 | Launch | 11/30/12
SQL 输出格式如下:
Website | Build Date | Revise Date | Launch Date
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Google | 10/30/12 | 11/15/12 | 11/30/12