【发布时间】:2022-10-05 02:43:31
【问题描述】:
我的数据如下:
Create table #student(id int, name varchar(20))
create table #test(id int, test_Date datetime, test_type varchar(20))
Insert int #student values (1, 'A')
insert into #student values (2, 'B')
insert into #student values (3, 'C')
insert into #test values (1, '1/1/2022', 'Math')
insert into #test values (1, '1/2/2022', 'Eng')
insert into #test values (1, '1/3/2022', 'Science')
insert into #test values (2, '2/1/2022', 'Math')
insert into #test values (2, '2/2/2022', 'Eng')
insert into #test values (3, '3/1/2022', 'Math')
insert into #test values (3, '3/2/2022', 'Science')
需要以下格式的数据: Output
【问题讨论】:
-
Please do not upload images of code/data/errors when asking a question. 虽然这看起来像是表示层的工作,不是SQL 层。
-
请阅读this,了解一些改进问题的技巧。其中一个重要部分:包括一个问题!你试过什么?研究过?
标签: tsql