How To Split Attributes Into Multiple Rows In SQL Server
Split attributes in one row into multiple rows using SQL Server's CROSS APPLY or esProc SPL for dynamic column-to-row transpositions.
How to Split Attributes of Same Type in One Row and Convert Them into Multiple Rows The actual table is rather wide and here we just use seven columns to do a computing a task. The goal is to split the same types of attributes in one row and put them into multiple rows. Desired result is as follows: Under STEP_NUMBER, we enter values in the form of STEP[n], populate STEP[n]_STATUS values , STEP[n]_START values and STEP[n]_END values to the corresponding columns, and calculate the difference between STEP[n]_END and STEP[n]_START. Below is SQL solution in SQL Server: SELECT A.ORDER_NUMBER ...