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