0

How to transpose the data in my SQL Server table from table 1 into table 2.

Table 1:

BatchNo StartDate StartTime EndDate EndTime RecipeNo Status
210722-A0001 2021-07-22 08:00:00.000 2021-07-22 10:00:00.000 1 Completed
210722-A0002 2021-07-22 10:30:00.000 2021-07-22 11:45:00.000 2 Completed

Table 2 :

Column1 Column2
210722-A0001 210722-A0002
2021-07-22 2021-07-22
08:00:00.000 10:30:00.000
2021-07-22 2021-07-22
10:00:00.000 11:45:00.000
1 2
Completed Completed

The number of columns in table 2 depends on the number of rows in table 1.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Faizul
  • 1

0 Answers0