原表数据:
实现结果:
脚本:
select a.PickDate,a.UserId,a.Apple from [dbo].[AppleBasket] cross apply ( values (PickDate,UserId,Apple1), (PickDate,UserId,Apple2), (PickDate,UserId,Apple3) ) a (PickDate,UserId,Apple)
参考链接:https://www.cnblogs.com/LessIsMoreZ/p/8302636.html
Copyright © 2025 樱木007 Powered by .NET 9.0 on Kubernetes