在openjson 里面,其实是可以把数据类型array里面的值遍历出来的,举个栗子 ) = N' {"name":"test", "obj":{"arr":[1,"ofao",3,4,5]} } ' select * from openjson(@v) /* key value type name test obj {"arr": */ select * from openjson (…
--直接返回 age FOR JSON PATH --返回值 [{"name":"张学友","age":60}] select c1, c2 from table FOR JSON PATH --带子集 age,'你好毒' AS [专辑.流行],'如果这都不算爱' AS [专辑.经典] FOR JSON PATH --返回值 [{"name":"张学友","age":60,"专…