Sql动态行转列
Sql动态⾏转列SQL动态⾏转列关键字:pivot复杂例⼦:(使⽤了连表查询)看⼀下图语句:--Studentselect * from [dbo].[Student]--StudentScoreselect * from [dbo].[StudentScore]--查询每天的加减分情况DECLARE @sql VARCHAR(8000),@col varchar(1000)set @col=(s...
2023-12-02 19 0
Sql动态⾏转列SQL动态⾏转列关键字:pivot复杂例⼦:(使⽤了连表查询)看⼀下图语句:--Studentselect * from [dbo].[Student]--StudentScoreselect * from [dbo].[StudentScore]--查询每天的加减分情况DECLARE @sql VARCHAR(8000),@col varchar(1000)set @col=(s...