3

If we PIVOT any table and UNPIVOT that table do we get our original table?

Mahmoud Gamal
  • 78,257
  • 17
  • 139
  • 164
MaxRecursion
  • 4,773
  • 12
  • 42
  • 76

2 Answers2

1

No, will not always get the same table as the original table. It depends on the kind of data that we are looking at.

Check the SQL Fiddles for @Mahmoud Gamal 's data.

SQL Fiddle With SUM

SQL Fiddle With MAX

Ravi Singh
  • 2,042
  • 13
  • 29
0

No you can get different result. because use aggregate function in pivote. and when you unpivote pivoted query maybe get different result, that such as aggregated orginal table on pivote fields.

mehdi lotfi
  • 11,194
  • 18
  • 82
  • 128