原数据:
实现以下效果:
sql语句:
SELECT playday,fee FROM [dbo].[CM_Contract] cross apply ( values ([FirstAmount],[PalnDay1]), ([SecondAmount],[PalnDay2]), ([ThirdAmount],[PalnDay3]) )c(fee,playday) where playday is not null