split-function

SQL Server: split record

女生的网名这么多〃 提交于 2019-12-22 17:40:35
问题 I have a table like this: account | check1 | check2 1 | 100]200]300 | 101]209]305 2 | 401]502 | 404]511 3 | 600 | 601 I want to separate the records into something like this: account | check1 | check2 1 | 100 | 101 1 | 200 | 209 1 | 300 | 305 2 | 401 | 404 2 | 502 | 511 . | . | . . | . | . . | . | . How do I do this using SQL server only ? Thanks, 回答1: First, you need a split function that can allow you to determine order within the result. This is a multi-statement TVF which uses an IDENTITY

SQL Server: split record

余生长醉 提交于 2019-12-22 17:40:04
问题 I have a table like this: account | check1 | check2 1 | 100]200]300 | 101]209]305 2 | 401]502 | 404]511 3 | 600 | 601 I want to separate the records into something like this: account | check1 | check2 1 | 100 | 101 1 | 200 | 209 1 | 300 | 305 2 | 401 | 404 2 | 502 | 511 . | . | . . | . | . . | . | . How do I do this using SQL server only ? Thanks, 回答1: First, you need a split function that can allow you to determine order within the result. This is a multi-statement TVF which uses an IDENTITY